diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/_app_platform_management_client.py index e546a23c6c3..1b7b8f2c671 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/_app_platform_management_client.py @@ -11,7 +11,9 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline import policies from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin @@ -74,7 +76,25 @@ def __init__( if api_version: kwargs.setdefault('api_version', api_version) self._config = AppPlatformManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) super(AppPlatformManagementClient, self).__init__( api_version=api_version, profile=profile @@ -107,6 +127,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2023-11-01-preview: :mod:`v2023_11_01_preview.models` * 2023-12-01: :mod:`v2023_12_01.models` * 2024-01-01-preview: :mod:`v2024_01_01_preview.models` + * 2024-05-01-preview: :mod:`v2024_05_01_preview.models` """ if api_version == '2020-07-01': from .v2020_07_01 import models @@ -165,6 +186,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2024-01-01-preview': from .v2024_01_01_preview import models return models + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -185,6 +209,7 @@ def api_portal_custom_domains(self): * 2023-11-01-preview: :class:`ApiPortalCustomDomainsOperations` * 2023-12-01: :class:`ApiPortalCustomDomainsOperations` * 2024-01-01-preview: :class:`ApiPortalCustomDomainsOperations` + * 2024-05-01-preview: :class:`ApiPortalCustomDomainsOperations` """ api_version = self._get_api_version('api_portal_custom_domains') if api_version == '2022-01-01-preview': @@ -215,6 +240,8 @@ def api_portal_custom_domains(self): from .v2023_12_01.operations import ApiPortalCustomDomainsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import ApiPortalCustomDomainsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import ApiPortalCustomDomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'api_portal_custom_domains'".format(api_version)) self._config.api_version = api_version @@ -238,6 +265,7 @@ def api_portals(self): * 2023-11-01-preview: :class:`ApiPortalsOperations` * 2023-12-01: :class:`ApiPortalsOperations` * 2024-01-01-preview: :class:`ApiPortalsOperations` + * 2024-05-01-preview: :class:`ApiPortalsOperations` """ api_version = self._get_api_version('api_portals') if api_version == '2022-01-01-preview': @@ -268,6 +296,8 @@ def api_portals(self): from .v2023_12_01.operations import ApiPortalsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import ApiPortalsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import ApiPortalsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'api_portals'".format(api_version)) self._config.api_version = api_version @@ -283,6 +313,7 @@ def apms(self): * 2023-11-01-preview: :class:`ApmsOperations` * 2023-12-01: :class:`ApmsOperations` * 2024-01-01-preview: :class:`ApmsOperations` + * 2024-05-01-preview: :class:`ApmsOperations` """ api_version = self._get_api_version('apms') if api_version == '2023-05-01-preview': @@ -297,6 +328,8 @@ def apms(self): from .v2023_12_01.operations import ApmsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import ApmsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import ApmsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'apms'".format(api_version)) self._config.api_version = api_version @@ -315,6 +348,7 @@ def application_accelerators(self): * 2023-11-01-preview: :class:`ApplicationAcceleratorsOperations` * 2023-12-01: :class:`ApplicationAcceleratorsOperations` * 2024-01-01-preview: :class:`ApplicationAcceleratorsOperations` + * 2024-05-01-preview: :class:`ApplicationAcceleratorsOperations` """ api_version = self._get_api_version('application_accelerators') if api_version == '2022-11-01-preview': @@ -335,6 +369,8 @@ def application_accelerators(self): from .v2023_12_01.operations import ApplicationAcceleratorsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import ApplicationAcceleratorsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import ApplicationAcceleratorsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'application_accelerators'".format(api_version)) self._config.api_version = api_version @@ -353,6 +389,7 @@ def application_live_views(self): * 2023-11-01-preview: :class:`ApplicationLiveViewsOperations` * 2023-12-01: :class:`ApplicationLiveViewsOperations` * 2024-01-01-preview: :class:`ApplicationLiveViewsOperations` + * 2024-05-01-preview: :class:`ApplicationLiveViewsOperations` """ api_version = self._get_api_version('application_live_views') if api_version == '2022-11-01-preview': @@ -373,6 +410,8 @@ def application_live_views(self): from .v2023_12_01.operations import ApplicationLiveViewsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import ApplicationLiveViewsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import ApplicationLiveViewsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'application_live_views'".format(api_version)) self._config.api_version = api_version @@ -401,6 +440,7 @@ def apps(self): * 2023-11-01-preview: :class:`AppsOperations` * 2023-12-01: :class:`AppsOperations` * 2024-01-01-preview: :class:`AppsOperations` + * 2024-05-01-preview: :class:`AppsOperations` """ api_version = self._get_api_version('apps') if api_version == '2020-07-01': @@ -441,6 +481,8 @@ def apps(self): from .v2023_12_01.operations import AppsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import AppsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import AppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'apps'".format(api_version)) self._config.api_version = api_version @@ -469,6 +511,7 @@ def bindings(self): * 2023-11-01-preview: :class:`BindingsOperations` * 2023-12-01: :class:`BindingsOperations` * 2024-01-01-preview: :class:`BindingsOperations` + * 2024-05-01-preview: :class:`BindingsOperations` """ api_version = self._get_api_version('bindings') if api_version == '2020-07-01': @@ -509,6 +552,8 @@ def bindings(self): from .v2023_12_01.operations import BindingsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import BindingsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import BindingsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'bindings'".format(api_version)) self._config.api_version = api_version @@ -533,6 +578,7 @@ def build_service(self): * 2023-11-01-preview: :class:`BuildServiceOperations` * 2023-12-01: :class:`BuildServiceOperations` * 2024-01-01-preview: :class:`BuildServiceOperations` + * 2024-05-01-preview: :class:`BuildServiceOperations` """ api_version = self._get_api_version('build_service') if api_version == '2022-01-01-preview': @@ -565,6 +611,8 @@ def build_service(self): from .v2023_12_01.operations import BuildServiceOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import BuildServiceOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import BuildServiceOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'build_service'".format(api_version)) self._config.api_version = api_version @@ -589,6 +637,7 @@ def build_service_agent_pool(self): * 2023-11-01-preview: :class:`BuildServiceAgentPoolOperations` * 2023-12-01: :class:`BuildServiceAgentPoolOperations` * 2024-01-01-preview: :class:`BuildServiceAgentPoolOperations` + * 2024-05-01-preview: :class:`BuildServiceAgentPoolOperations` """ api_version = self._get_api_version('build_service_agent_pool') if api_version == '2022-01-01-preview': @@ -621,6 +670,8 @@ def build_service_agent_pool(self): from .v2023_12_01.operations import BuildServiceAgentPoolOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import BuildServiceAgentPoolOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import BuildServiceAgentPoolOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'build_service_agent_pool'".format(api_version)) self._config.api_version = api_version @@ -645,6 +696,7 @@ def build_service_builder(self): * 2023-11-01-preview: :class:`BuildServiceBuilderOperations` * 2023-12-01: :class:`BuildServiceBuilderOperations` * 2024-01-01-preview: :class:`BuildServiceBuilderOperations` + * 2024-05-01-preview: :class:`BuildServiceBuilderOperations` """ api_version = self._get_api_version('build_service_builder') if api_version == '2022-01-01-preview': @@ -677,6 +729,8 @@ def build_service_builder(self): from .v2023_12_01.operations import BuildServiceBuilderOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import BuildServiceBuilderOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import BuildServiceBuilderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'build_service_builder'".format(api_version)) self._config.api_version = api_version @@ -701,6 +755,7 @@ def buildpack_binding(self): * 2023-11-01-preview: :class:`BuildpackBindingOperations` * 2023-12-01: :class:`BuildpackBindingOperations` * 2024-01-01-preview: :class:`BuildpackBindingOperations` + * 2024-05-01-preview: :class:`BuildpackBindingOperations` """ api_version = self._get_api_version('buildpack_binding') if api_version == '2022-01-01-preview': @@ -733,6 +788,8 @@ def buildpack_binding(self): from .v2023_12_01.operations import BuildpackBindingOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import BuildpackBindingOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import BuildpackBindingOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'buildpack_binding'".format(api_version)) self._config.api_version = api_version @@ -761,6 +818,7 @@ def certificates(self): * 2023-11-01-preview: :class:`CertificatesOperations` * 2023-12-01: :class:`CertificatesOperations` * 2024-01-01-preview: :class:`CertificatesOperations` + * 2024-05-01-preview: :class:`CertificatesOperations` """ api_version = self._get_api_version('certificates') if api_version == '2020-07-01': @@ -801,6 +859,8 @@ def certificates(self): from .v2023_12_01.operations import CertificatesOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import CertificatesOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import CertificatesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'certificates'".format(api_version)) self._config.api_version = api_version @@ -829,6 +889,7 @@ def config_servers(self): * 2023-11-01-preview: :class:`ConfigServersOperations` * 2023-12-01: :class:`ConfigServersOperations` * 2024-01-01-preview: :class:`ConfigServersOperations` + * 2024-05-01-preview: :class:`ConfigServersOperations` """ api_version = self._get_api_version('config_servers') if api_version == '2020-07-01': @@ -869,6 +930,8 @@ def config_servers(self): from .v2023_12_01.operations import ConfigServersOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import ConfigServersOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import ConfigServersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'config_servers'".format(api_version)) self._config.api_version = api_version @@ -893,6 +956,7 @@ def configuration_services(self): * 2023-11-01-preview: :class:`ConfigurationServicesOperations` * 2023-12-01: :class:`ConfigurationServicesOperations` * 2024-01-01-preview: :class:`ConfigurationServicesOperations` + * 2024-05-01-preview: :class:`ConfigurationServicesOperations` """ api_version = self._get_api_version('configuration_services') if api_version == '2022-01-01-preview': @@ -925,6 +989,8 @@ def configuration_services(self): from .v2023_12_01.operations import ConfigurationServicesOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import ConfigurationServicesOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import ConfigurationServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'configuration_services'".format(api_version)) self._config.api_version = api_version @@ -941,6 +1007,7 @@ def container_registries(self): * 2023-11-01-preview: :class:`ContainerRegistriesOperations` * 2023-12-01: :class:`ContainerRegistriesOperations` * 2024-01-01-preview: :class:`ContainerRegistriesOperations` + * 2024-05-01-preview: :class:`ContainerRegistriesOperations` """ api_version = self._get_api_version('container_registries') if api_version == '2023-03-01-preview': @@ -957,6 +1024,8 @@ def container_registries(self): from .v2023_12_01.operations import ContainerRegistriesOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import ContainerRegistriesOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import ContainerRegistriesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'container_registries'".format(api_version)) self._config.api_version = api_version @@ -985,6 +1054,7 @@ def custom_domains(self): * 2023-11-01-preview: :class:`CustomDomainsOperations` * 2023-12-01: :class:`CustomDomainsOperations` * 2024-01-01-preview: :class:`CustomDomainsOperations` + * 2024-05-01-preview: :class:`CustomDomainsOperations` """ api_version = self._get_api_version('custom_domains') if api_version == '2020-07-01': @@ -1025,6 +1095,8 @@ def custom_domains(self): from .v2023_12_01.operations import CustomDomainsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import CustomDomainsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import CustomDomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'custom_domains'".format(api_version)) self._config.api_version = api_version @@ -1043,6 +1115,7 @@ def customized_accelerators(self): * 2023-11-01-preview: :class:`CustomizedAcceleratorsOperations` * 2023-12-01: :class:`CustomizedAcceleratorsOperations` * 2024-01-01-preview: :class:`CustomizedAcceleratorsOperations` + * 2024-05-01-preview: :class:`CustomizedAcceleratorsOperations` """ api_version = self._get_api_version('customized_accelerators') if api_version == '2022-11-01-preview': @@ -1063,6 +1136,8 @@ def customized_accelerators(self): from .v2023_12_01.operations import CustomizedAcceleratorsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import CustomizedAcceleratorsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import CustomizedAcceleratorsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'customized_accelerators'".format(api_version)) self._config.api_version = api_version @@ -1091,6 +1166,7 @@ def deployments(self): * 2023-11-01-preview: :class:`DeploymentsOperations` * 2023-12-01: :class:`DeploymentsOperations` * 2024-01-01-preview: :class:`DeploymentsOperations` + * 2024-05-01-preview: :class:`DeploymentsOperations` """ api_version = self._get_api_version('deployments') if api_version == '2020-07-01': @@ -1131,6 +1207,8 @@ def deployments(self): from .v2023_12_01.operations import DeploymentsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import DeploymentsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import DeploymentsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'deployments'".format(api_version)) self._config.api_version = api_version @@ -1149,6 +1227,7 @@ def dev_tool_portals(self): * 2023-11-01-preview: :class:`DevToolPortalsOperations` * 2023-12-01: :class:`DevToolPortalsOperations` * 2024-01-01-preview: :class:`DevToolPortalsOperations` + * 2024-05-01-preview: :class:`DevToolPortalsOperations` """ api_version = self._get_api_version('dev_tool_portals') if api_version == '2022-11-01-preview': @@ -1169,6 +1248,8 @@ def dev_tool_portals(self): from .v2023_12_01.operations import DevToolPortalsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import DevToolPortalsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import DevToolPortalsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'dev_tool_portals'".format(api_version)) self._config.api_version = api_version @@ -1183,6 +1264,7 @@ def eureka_servers(self): * 2023-09-01-preview: :class:`EurekaServersOperations` * 2023-11-01-preview: :class:`EurekaServersOperations` * 2024-01-01-preview: :class:`EurekaServersOperations` + * 2024-05-01-preview: :class:`EurekaServersOperations` """ api_version = self._get_api_version('eureka_servers') if api_version == '2023-05-01-preview': @@ -1195,6 +1277,8 @@ def eureka_servers(self): from .v2023_11_01_preview.operations import EurekaServersOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import EurekaServersOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import EurekaServersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'eureka_servers'".format(api_version)) self._config.api_version = api_version @@ -1218,6 +1302,7 @@ def gateway_custom_domains(self): * 2023-11-01-preview: :class:`GatewayCustomDomainsOperations` * 2023-12-01: :class:`GatewayCustomDomainsOperations` * 2024-01-01-preview: :class:`GatewayCustomDomainsOperations` + * 2024-05-01-preview: :class:`GatewayCustomDomainsOperations` """ api_version = self._get_api_version('gateway_custom_domains') if api_version == '2022-01-01-preview': @@ -1248,6 +1333,8 @@ def gateway_custom_domains(self): from .v2023_12_01.operations import GatewayCustomDomainsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import GatewayCustomDomainsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import GatewayCustomDomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gateway_custom_domains'".format(api_version)) self._config.api_version = api_version @@ -1271,6 +1358,7 @@ def gateway_route_configs(self): * 2023-11-01-preview: :class:`GatewayRouteConfigsOperations` * 2023-12-01: :class:`GatewayRouteConfigsOperations` * 2024-01-01-preview: :class:`GatewayRouteConfigsOperations` + * 2024-05-01-preview: :class:`GatewayRouteConfigsOperations` """ api_version = self._get_api_version('gateway_route_configs') if api_version == '2022-01-01-preview': @@ -1301,6 +1389,8 @@ def gateway_route_configs(self): from .v2023_12_01.operations import GatewayRouteConfigsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import GatewayRouteConfigsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import GatewayRouteConfigsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gateway_route_configs'".format(api_version)) self._config.api_version = api_version @@ -1324,6 +1414,7 @@ def gateways(self): * 2023-11-01-preview: :class:`GatewaysOperations` * 2023-12-01: :class:`GatewaysOperations` * 2024-01-01-preview: :class:`GatewaysOperations` + * 2024-05-01-preview: :class:`GatewaysOperations` """ api_version = self._get_api_version('gateways') if api_version == '2022-01-01-preview': @@ -1354,11 +1445,69 @@ def gateways(self): from .v2023_12_01.operations import GatewaysOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import GatewaysOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import GatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gateways'".format(api_version)) self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + @property + def job(self): + """Instance depends on the API version: + + * 2024-05-01-preview: :class:`JobOperations` + """ + api_version = self._get_api_version('job') + if api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import JobOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'job'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + + @property + def job_execution(self): + """Instance depends on the API version: + + * 2024-05-01-preview: :class:`JobExecutionOperations` + """ + api_version = self._get_api_version('job_execution') + if api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import JobExecutionOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'job_execution'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + + @property + def job_executions(self): + """Instance depends on the API version: + + * 2024-05-01-preview: :class:`JobExecutionsOperations` + """ + api_version = self._get_api_version('job_executions') + if api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import JobExecutionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'job_executions'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + + @property + def jobs(self): + """Instance depends on the API version: + + * 2024-05-01-preview: :class:`JobsOperations` + """ + api_version = self._get_api_version('jobs') + if api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import JobsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'jobs'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + @property def monitoring_settings(self): """Instance depends on the API version: @@ -1382,6 +1531,7 @@ def monitoring_settings(self): * 2023-11-01-preview: :class:`MonitoringSettingsOperations` * 2023-12-01: :class:`MonitoringSettingsOperations` * 2024-01-01-preview: :class:`MonitoringSettingsOperations` + * 2024-05-01-preview: :class:`MonitoringSettingsOperations` """ api_version = self._get_api_version('monitoring_settings') if api_version == '2020-07-01': @@ -1422,6 +1572,8 @@ def monitoring_settings(self): from .v2023_12_01.operations import MonitoringSettingsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import MonitoringSettingsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import MonitoringSettingsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'monitoring_settings'".format(api_version)) self._config.api_version = api_version @@ -1450,6 +1602,7 @@ def operations(self): * 2023-11-01-preview: :class:`Operations` * 2023-12-01: :class:`Operations` * 2024-01-01-preview: :class:`Operations` + * 2024-05-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2020-07-01': @@ -1490,6 +1643,8 @@ def operations(self): from .v2023_12_01.operations import Operations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import Operations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) self._config.api_version = api_version @@ -1508,6 +1663,7 @@ def predefined_accelerators(self): * 2023-11-01-preview: :class:`PredefinedAcceleratorsOperations` * 2023-12-01: :class:`PredefinedAcceleratorsOperations` * 2024-01-01-preview: :class:`PredefinedAcceleratorsOperations` + * 2024-05-01-preview: :class:`PredefinedAcceleratorsOperations` """ api_version = self._get_api_version('predefined_accelerators') if api_version == '2022-11-01-preview': @@ -1528,6 +1684,8 @@ def predefined_accelerators(self): from .v2023_12_01.operations import PredefinedAcceleratorsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import PredefinedAcceleratorsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import PredefinedAcceleratorsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'predefined_accelerators'".format(api_version)) self._config.api_version = api_version @@ -1556,6 +1714,7 @@ def runtime_versions(self): * 2023-11-01-preview: :class:`RuntimeVersionsOperations` * 2023-12-01: :class:`RuntimeVersionsOperations` * 2024-01-01-preview: :class:`RuntimeVersionsOperations` + * 2024-05-01-preview: :class:`RuntimeVersionsOperations` """ api_version = self._get_api_version('runtime_versions') if api_version == '2020-07-01': @@ -1596,6 +1755,8 @@ def runtime_versions(self): from .v2023_12_01.operations import RuntimeVersionsOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import RuntimeVersionsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import RuntimeVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'runtime_versions'".format(api_version)) self._config.api_version = api_version @@ -1620,6 +1781,7 @@ def service_registries(self): * 2023-11-01-preview: :class:`ServiceRegistriesOperations` * 2023-12-01: :class:`ServiceRegistriesOperations` * 2024-01-01-preview: :class:`ServiceRegistriesOperations` + * 2024-05-01-preview: :class:`ServiceRegistriesOperations` """ api_version = self._get_api_version('service_registries') if api_version == '2022-01-01-preview': @@ -1652,6 +1814,8 @@ def service_registries(self): from .v2023_12_01.operations import ServiceRegistriesOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import ServiceRegistriesOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import ServiceRegistriesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'service_registries'".format(api_version)) self._config.api_version = api_version @@ -1680,6 +1844,7 @@ def services(self): * 2023-11-01-preview: :class:`ServicesOperations` * 2023-12-01: :class:`ServicesOperations` * 2024-01-01-preview: :class:`ServicesOperations` + * 2024-05-01-preview: :class:`ServicesOperations` """ api_version = self._get_api_version('services') if api_version == '2020-07-01': @@ -1720,6 +1885,8 @@ def services(self): from .v2023_12_01.operations import ServicesOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import ServicesOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import ServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'services'".format(api_version)) self._config.api_version = api_version @@ -1748,6 +1915,7 @@ def skus(self): * 2023-11-01-preview: :class:`SkusOperations` * 2023-12-01: :class:`SkusOperations` * 2024-01-01-preview: :class:`SkusOperations` + * 2024-05-01-preview: :class:`SkusOperations` """ api_version = self._get_api_version('skus') if api_version == '2020-07-01': @@ -1788,6 +1956,8 @@ def skus(self): from .v2023_12_01.operations import SkusOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import SkusOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import SkusOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'skus'".format(api_version)) self._config.api_version = api_version @@ -1812,6 +1982,7 @@ def storages(self): * 2023-11-01-preview: :class:`StoragesOperations` * 2023-12-01: :class:`StoragesOperations` * 2024-01-01-preview: :class:`StoragesOperations` + * 2024-05-01-preview: :class:`StoragesOperations` """ api_version = self._get_api_version('storages') if api_version == '2021-09-01-preview': @@ -1844,6 +2015,8 @@ def storages(self): from .v2023_12_01.operations import StoragesOperations as OperationClass elif api_version == '2024-01-01-preview': from .v2024_01_01_preview.operations import StoragesOperations as OperationClass + elif api_version == '2024-05-01-preview': + from .v2024_05_01_preview.operations import StoragesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'storages'".format(api_version)) self._config.api_version = api_version diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/_configuration.py index c649ece7af8..60fd3d0c609 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/_configuration.py @@ -10,7 +10,6 @@ # -------------------------------------------------------------------------- from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -20,7 +19,7 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): +class AppPlatformManagementClientConfiguration: """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -42,12 +41,12 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'azure-mgmt-appplatform/{}'.format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/_serialization.py b/src/spring/azext_spring/vendored_sdks/appplatform/_serialization.py index a00658b1fc1..75e26c415d2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/_serialization.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/_serialization.py @@ -63,8 +63,8 @@ import isodate # type: ignore -from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback -from azure.core.serialization import NULL as AzureCoreNull +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") @@ -124,7 +124,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: pass return ET.fromstring(data_as_str) # nosec - except ET.ParseError: + except ET.ParseError as err: # It might be because the server has an issue, and returned JSON with # content-type XML.... # So let's try a JSON load, and if it's still broken @@ -143,7 +143,7 @@ def _json_attemp(data): # The function hack is because Py2.7 messes up with exception # context otherwise. _LOGGER.critical("Wasn't XML not JSON, failing") - raise_with_traceback(DeserializationError, "XML is invalid") + raise DeserializationError("XML is invalid") from err raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod @@ -170,13 +170,6 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], return None -try: - basestring # type: ignore - unicode_str = unicode # type: ignore -except NameError: - basestring = str - unicode_str = str - _LOGGER = logging.getLogger(__name__) try: @@ -295,7 +288,7 @@ class Model(object): _validation: Dict[str, Dict[str, Any]] = {} def __init__(self, **kwargs: Any) -> None: - self.additional_properties: Dict[str, Any] = {} + self.additional_properties: Optional[Dict[str, Any]] = {} for k in kwargs: if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -340,7 +333,7 @@ def _create_xml_node(cls): return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: - """Return the JSON that would be sent to azure from this model. + """Return the JSON that would be sent to server from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -351,7 +344,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) + return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore def as_dict( self, @@ -392,7 +385,7 @@ def my_key_transformer(key, attr_desc, value): :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) + return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore @classmethod def _infer_class_models(cls): @@ -417,7 +410,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - return deserializer(cls.__name__, data, content_type=content_type) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( @@ -447,7 +440,7 @@ def from_dict( if key_extractors is None else key_extractors ) - return deserializer(cls.__name__, data, content_type=content_type) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def _flatten_subtype(cls, key, objects): @@ -547,7 +540,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): + def __init__(self, classes: Optional[Mapping[str, type]]=None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -563,7 +556,7 @@ def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} + self.dependencies: Dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -651,7 +644,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): else: # That's a basic type # Integrate namespace if necessary local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) - local_node.text = unicode_str(new_attr) + local_node.text = str(new_attr) serialized.append(local_node) # type: ignore else: # JSON for k in reversed(keys): # type: ignore @@ -670,7 +663,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) - raise_with_traceback(SerializationError, msg, err) + raise SerializationError(msg) from err else: return serialized @@ -712,7 +705,7 @@ def body(self, data, data_type, **kwargs): ] data = deserializer._deserialize(data_type, data) except DeserializationError as err: - raise_with_traceback(SerializationError, "Unable to build a model: " + str(err), err) + raise SerializationError("Unable to build a model: " + str(err)) from err return self._serialize(data, data_type, **kwargs) @@ -732,6 +725,7 @@ def url(self, name, data, data_type, **kwargs): if kwargs.get("skip_quote") is True: output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") except SerializationError: @@ -746,7 +740,7 @@ def query(self, name, data, data_type, **kwargs): :param str data_type: The type to be serialized from. :keyword bool skip_quote: Whether to skip quote the serialized result. Defaults to False. - :rtype: str + :rtype: str, list :raises: TypeError if serialization fails. :raises: ValueError if data is None """ @@ -755,7 +749,7 @@ def query(self, name, data, data_type, **kwargs): if data_type.startswith("["): internal_data_type = data_type[1:-1] do_quote = not kwargs.get('skip_quote', False) - return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -806,7 +800,7 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: - if data is AzureCoreNull: + if data is CoreNull: return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -826,7 +820,7 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." - raise_with_traceback(SerializationError, msg.format(data, data_type), err) + raise SerializationError(msg.format(data, data_type)) from err else: return self._serialize(data, **kwargs) @@ -999,7 +993,7 @@ def serialize_object(self, attr, **kwargs): return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) if obj_type is _long_type: return self.serialize_long(attr) - if obj_type is unicode_str: + if obj_type is str: return self.serialize_unicode(attr) if obj_type is datetime.datetime: return self.serialize_iso(attr) @@ -1176,10 +1170,10 @@ def serialize_iso(attr, **kwargs): return date + microseconds + "Z" except (ValueError, OverflowError) as err: msg = "Unable to serialize datetime object." - raise_with_traceback(SerializationError, msg, err) + raise SerializationError(msg) from err except AttributeError as err: msg = "ISO-8601 object must be valid Datetime object." - raise_with_traceback(TypeError, msg, err) + raise TypeError(msg) from err @staticmethod def serialize_unix(attr, **kwargs): @@ -1215,7 +1209,6 @@ def rest_key_extractor(attr, attr_desc, data): if working_data is None: # If at any point while following flatten JSON path see None, it means # that all properties under are None as well - # https://github.com/Azure/msrest-for-python/issues/197 return None key = ".".join(dict_keys[1:]) @@ -1236,7 +1229,6 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): if working_data is None: # If at any point while following flatten JSON path see None, it means # that all properties under are None as well - # https://github.com/Azure/msrest-for-python/issues/197 return None key = ".".join(dict_keys[1:]) @@ -1377,7 +1369,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): + def __init__(self, classes: Optional[Mapping[str, type]]=None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1397,7 +1389,7 @@ def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} + self.dependencies: Dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1450,7 +1442,7 @@ def _deserialize(self, target_obj, data): response, class_name = self._classify_target(target_obj, data) - if isinstance(response, basestring): + if isinstance(response, str): return self.deserialize_data(data, response) elif isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) @@ -1487,7 +1479,7 @@ def _deserialize(self, target_obj, data): d_attrs[attr] = value except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: additional_properties = self._build_additional_properties(attributes, data) return self._instantiate_model(response, d_attrs, additional_properties) @@ -1521,14 +1513,14 @@ def _classify_target(self, target, data): if target is None: return None, None - if isinstance(target, basestring): + if isinstance(target, str): try: target = self.dependencies[target] except KeyError: return target, target try: - target = target._classify(data, self.dependencies) + target = target._classify(data, self.dependencies) # type: ignore except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1584,7 +1576,7 @@ def _unpack_content(raw_data, content_type=None): if hasattr(raw_data, "_content_consumed"): return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) - if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore return raw_data @@ -1658,7 +1650,7 @@ def deserialize_data(self, data, data_type): except (ValueError, TypeError, AttributeError) as err: msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return self._deserialize(obj_type, data) @@ -1706,7 +1698,7 @@ def deserialize_object(self, attr, **kwargs): if isinstance(attr, ET.Element): # Do no recurse on XML, just return the tree as-is return attr - if isinstance(attr, basestring): + if isinstance(attr, str): return self.deserialize_basic(attr, "str") obj_type = type(attr) if obj_type in self.basic_types: @@ -1763,7 +1755,7 @@ def deserialize_basic(self, attr, data_type): if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) - elif isinstance(attr, basestring): + elif isinstance(attr, str): if attr.lower() in ["true", "1"]: return True elif attr.lower() in ["false", "0"]: @@ -1814,7 +1806,6 @@ def deserialize_enum(data, enum_obj): data = data.value if isinstance(data, int): # Workaround. We might consider remove it in the future. - # https://github.com/Azure/azure-rest-api-specs/issues/141 try: return list(enum_obj.__members__.values())[data] except IndexError: @@ -1868,10 +1859,10 @@ def deserialize_decimal(attr): if isinstance(attr, ET.Element): attr = attr.text try: - return decimal.Decimal(attr) # type: ignore + return decimal.Decimal(str(attr)) # type: ignore except decimal.DecimalException as err: msg = "Invalid decimal {}".format(attr) - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err @staticmethod def deserialize_long(attr): @@ -1899,7 +1890,7 @@ def deserialize_duration(attr): duration = isodate.parse_duration(attr) except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return duration @@ -1916,7 +1907,7 @@ def deserialize_date(attr): if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. - return isodate.parse_date(attr, defaultmonth=None, defaultday=None) + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) @staticmethod def deserialize_time(attr): @@ -1951,7 +1942,7 @@ def deserialize_rfc(attr): date_obj = date_obj.astimezone(tz=TZ_UTC) except ValueError as err: msg = "Cannot deserialize to rfc datetime object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return date_obj @@ -1988,7 +1979,7 @@ def deserialize_iso(attr): raise OverflowError("Hit max or min date") except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return date_obj @@ -2004,9 +1995,10 @@ def deserialize_unix(attr): if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore try: + attr = int(attr) date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) except ValueError as err: msg = "Cannot deserialize to unix datetime object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return date_obj diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/_version.py b/src/spring/azext_spring/vendored_sdks/appplatform/_version.py index b56384cd463..14d0091047a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/_version.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "8.0.0" +VERSION = "9.0.0" diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/aio/_app_platform_management_client.py index ca4cae2bc9a..362fb6aca82 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/aio/_app_platform_management_client.py @@ -11,7 +11,9 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline import policies from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin @@ -74,7 +76,25 @@ def __init__( if api_version: kwargs.setdefault('api_version', api_version) self._config = AppPlatformManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) super(AppPlatformManagementClient, self).__init__( api_version=api_version, profile=profile @@ -107,6 +127,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2023-11-01-preview: :mod:`v2023_11_01_preview.models` * 2023-12-01: :mod:`v2023_12_01.models` * 2024-01-01-preview: :mod:`v2024_01_01_preview.models` + * 2024-05-01-preview: :mod:`v2024_05_01_preview.models` """ if api_version == '2020-07-01': from ..v2020_07_01 import models @@ -165,6 +186,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview import models return models + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -185,6 +209,7 @@ def api_portal_custom_domains(self): * 2023-11-01-preview: :class:`ApiPortalCustomDomainsOperations` * 2023-12-01: :class:`ApiPortalCustomDomainsOperations` * 2024-01-01-preview: :class:`ApiPortalCustomDomainsOperations` + * 2024-05-01-preview: :class:`ApiPortalCustomDomainsOperations` """ api_version = self._get_api_version('api_portal_custom_domains') if api_version == '2022-01-01-preview': @@ -215,6 +240,8 @@ def api_portal_custom_domains(self): from ..v2023_12_01.aio.operations import ApiPortalCustomDomainsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import ApiPortalCustomDomainsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import ApiPortalCustomDomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'api_portal_custom_domains'".format(api_version)) self._config.api_version = api_version @@ -238,6 +265,7 @@ def api_portals(self): * 2023-11-01-preview: :class:`ApiPortalsOperations` * 2023-12-01: :class:`ApiPortalsOperations` * 2024-01-01-preview: :class:`ApiPortalsOperations` + * 2024-05-01-preview: :class:`ApiPortalsOperations` """ api_version = self._get_api_version('api_portals') if api_version == '2022-01-01-preview': @@ -268,6 +296,8 @@ def api_portals(self): from ..v2023_12_01.aio.operations import ApiPortalsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import ApiPortalsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import ApiPortalsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'api_portals'".format(api_version)) self._config.api_version = api_version @@ -283,6 +313,7 @@ def apms(self): * 2023-11-01-preview: :class:`ApmsOperations` * 2023-12-01: :class:`ApmsOperations` * 2024-01-01-preview: :class:`ApmsOperations` + * 2024-05-01-preview: :class:`ApmsOperations` """ api_version = self._get_api_version('apms') if api_version == '2023-05-01-preview': @@ -297,6 +328,8 @@ def apms(self): from ..v2023_12_01.aio.operations import ApmsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import ApmsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import ApmsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'apms'".format(api_version)) self._config.api_version = api_version @@ -315,6 +348,7 @@ def application_accelerators(self): * 2023-11-01-preview: :class:`ApplicationAcceleratorsOperations` * 2023-12-01: :class:`ApplicationAcceleratorsOperations` * 2024-01-01-preview: :class:`ApplicationAcceleratorsOperations` + * 2024-05-01-preview: :class:`ApplicationAcceleratorsOperations` """ api_version = self._get_api_version('application_accelerators') if api_version == '2022-11-01-preview': @@ -335,6 +369,8 @@ def application_accelerators(self): from ..v2023_12_01.aio.operations import ApplicationAcceleratorsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import ApplicationAcceleratorsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import ApplicationAcceleratorsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'application_accelerators'".format(api_version)) self._config.api_version = api_version @@ -353,6 +389,7 @@ def application_live_views(self): * 2023-11-01-preview: :class:`ApplicationLiveViewsOperations` * 2023-12-01: :class:`ApplicationLiveViewsOperations` * 2024-01-01-preview: :class:`ApplicationLiveViewsOperations` + * 2024-05-01-preview: :class:`ApplicationLiveViewsOperations` """ api_version = self._get_api_version('application_live_views') if api_version == '2022-11-01-preview': @@ -373,6 +410,8 @@ def application_live_views(self): from ..v2023_12_01.aio.operations import ApplicationLiveViewsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import ApplicationLiveViewsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import ApplicationLiveViewsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'application_live_views'".format(api_version)) self._config.api_version = api_version @@ -401,6 +440,7 @@ def apps(self): * 2023-11-01-preview: :class:`AppsOperations` * 2023-12-01: :class:`AppsOperations` * 2024-01-01-preview: :class:`AppsOperations` + * 2024-05-01-preview: :class:`AppsOperations` """ api_version = self._get_api_version('apps') if api_version == '2020-07-01': @@ -441,6 +481,8 @@ def apps(self): from ..v2023_12_01.aio.operations import AppsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import AppsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import AppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'apps'".format(api_version)) self._config.api_version = api_version @@ -469,6 +511,7 @@ def bindings(self): * 2023-11-01-preview: :class:`BindingsOperations` * 2023-12-01: :class:`BindingsOperations` * 2024-01-01-preview: :class:`BindingsOperations` + * 2024-05-01-preview: :class:`BindingsOperations` """ api_version = self._get_api_version('bindings') if api_version == '2020-07-01': @@ -509,6 +552,8 @@ def bindings(self): from ..v2023_12_01.aio.operations import BindingsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import BindingsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import BindingsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'bindings'".format(api_version)) self._config.api_version = api_version @@ -533,6 +578,7 @@ def build_service(self): * 2023-11-01-preview: :class:`BuildServiceOperations` * 2023-12-01: :class:`BuildServiceOperations` * 2024-01-01-preview: :class:`BuildServiceOperations` + * 2024-05-01-preview: :class:`BuildServiceOperations` """ api_version = self._get_api_version('build_service') if api_version == '2022-01-01-preview': @@ -565,6 +611,8 @@ def build_service(self): from ..v2023_12_01.aio.operations import BuildServiceOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import BuildServiceOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import BuildServiceOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'build_service'".format(api_version)) self._config.api_version = api_version @@ -589,6 +637,7 @@ def build_service_agent_pool(self): * 2023-11-01-preview: :class:`BuildServiceAgentPoolOperations` * 2023-12-01: :class:`BuildServiceAgentPoolOperations` * 2024-01-01-preview: :class:`BuildServiceAgentPoolOperations` + * 2024-05-01-preview: :class:`BuildServiceAgentPoolOperations` """ api_version = self._get_api_version('build_service_agent_pool') if api_version == '2022-01-01-preview': @@ -621,6 +670,8 @@ def build_service_agent_pool(self): from ..v2023_12_01.aio.operations import BuildServiceAgentPoolOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import BuildServiceAgentPoolOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import BuildServiceAgentPoolOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'build_service_agent_pool'".format(api_version)) self._config.api_version = api_version @@ -645,6 +696,7 @@ def build_service_builder(self): * 2023-11-01-preview: :class:`BuildServiceBuilderOperations` * 2023-12-01: :class:`BuildServiceBuilderOperations` * 2024-01-01-preview: :class:`BuildServiceBuilderOperations` + * 2024-05-01-preview: :class:`BuildServiceBuilderOperations` """ api_version = self._get_api_version('build_service_builder') if api_version == '2022-01-01-preview': @@ -677,6 +729,8 @@ def build_service_builder(self): from ..v2023_12_01.aio.operations import BuildServiceBuilderOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import BuildServiceBuilderOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import BuildServiceBuilderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'build_service_builder'".format(api_version)) self._config.api_version = api_version @@ -701,6 +755,7 @@ def buildpack_binding(self): * 2023-11-01-preview: :class:`BuildpackBindingOperations` * 2023-12-01: :class:`BuildpackBindingOperations` * 2024-01-01-preview: :class:`BuildpackBindingOperations` + * 2024-05-01-preview: :class:`BuildpackBindingOperations` """ api_version = self._get_api_version('buildpack_binding') if api_version == '2022-01-01-preview': @@ -733,6 +788,8 @@ def buildpack_binding(self): from ..v2023_12_01.aio.operations import BuildpackBindingOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import BuildpackBindingOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import BuildpackBindingOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'buildpack_binding'".format(api_version)) self._config.api_version = api_version @@ -761,6 +818,7 @@ def certificates(self): * 2023-11-01-preview: :class:`CertificatesOperations` * 2023-12-01: :class:`CertificatesOperations` * 2024-01-01-preview: :class:`CertificatesOperations` + * 2024-05-01-preview: :class:`CertificatesOperations` """ api_version = self._get_api_version('certificates') if api_version == '2020-07-01': @@ -801,6 +859,8 @@ def certificates(self): from ..v2023_12_01.aio.operations import CertificatesOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import CertificatesOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import CertificatesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'certificates'".format(api_version)) self._config.api_version = api_version @@ -829,6 +889,7 @@ def config_servers(self): * 2023-11-01-preview: :class:`ConfigServersOperations` * 2023-12-01: :class:`ConfigServersOperations` * 2024-01-01-preview: :class:`ConfigServersOperations` + * 2024-05-01-preview: :class:`ConfigServersOperations` """ api_version = self._get_api_version('config_servers') if api_version == '2020-07-01': @@ -869,6 +930,8 @@ def config_servers(self): from ..v2023_12_01.aio.operations import ConfigServersOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import ConfigServersOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import ConfigServersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'config_servers'".format(api_version)) self._config.api_version = api_version @@ -893,6 +956,7 @@ def configuration_services(self): * 2023-11-01-preview: :class:`ConfigurationServicesOperations` * 2023-12-01: :class:`ConfigurationServicesOperations` * 2024-01-01-preview: :class:`ConfigurationServicesOperations` + * 2024-05-01-preview: :class:`ConfigurationServicesOperations` """ api_version = self._get_api_version('configuration_services') if api_version == '2022-01-01-preview': @@ -925,6 +989,8 @@ def configuration_services(self): from ..v2023_12_01.aio.operations import ConfigurationServicesOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import ConfigurationServicesOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import ConfigurationServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'configuration_services'".format(api_version)) self._config.api_version = api_version @@ -941,6 +1007,7 @@ def container_registries(self): * 2023-11-01-preview: :class:`ContainerRegistriesOperations` * 2023-12-01: :class:`ContainerRegistriesOperations` * 2024-01-01-preview: :class:`ContainerRegistriesOperations` + * 2024-05-01-preview: :class:`ContainerRegistriesOperations` """ api_version = self._get_api_version('container_registries') if api_version == '2023-03-01-preview': @@ -957,6 +1024,8 @@ def container_registries(self): from ..v2023_12_01.aio.operations import ContainerRegistriesOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import ContainerRegistriesOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import ContainerRegistriesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'container_registries'".format(api_version)) self._config.api_version = api_version @@ -985,6 +1054,7 @@ def custom_domains(self): * 2023-11-01-preview: :class:`CustomDomainsOperations` * 2023-12-01: :class:`CustomDomainsOperations` * 2024-01-01-preview: :class:`CustomDomainsOperations` + * 2024-05-01-preview: :class:`CustomDomainsOperations` """ api_version = self._get_api_version('custom_domains') if api_version == '2020-07-01': @@ -1025,6 +1095,8 @@ def custom_domains(self): from ..v2023_12_01.aio.operations import CustomDomainsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import CustomDomainsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import CustomDomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'custom_domains'".format(api_version)) self._config.api_version = api_version @@ -1043,6 +1115,7 @@ def customized_accelerators(self): * 2023-11-01-preview: :class:`CustomizedAcceleratorsOperations` * 2023-12-01: :class:`CustomizedAcceleratorsOperations` * 2024-01-01-preview: :class:`CustomizedAcceleratorsOperations` + * 2024-05-01-preview: :class:`CustomizedAcceleratorsOperations` """ api_version = self._get_api_version('customized_accelerators') if api_version == '2022-11-01-preview': @@ -1063,6 +1136,8 @@ def customized_accelerators(self): from ..v2023_12_01.aio.operations import CustomizedAcceleratorsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import CustomizedAcceleratorsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import CustomizedAcceleratorsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'customized_accelerators'".format(api_version)) self._config.api_version = api_version @@ -1091,6 +1166,7 @@ def deployments(self): * 2023-11-01-preview: :class:`DeploymentsOperations` * 2023-12-01: :class:`DeploymentsOperations` * 2024-01-01-preview: :class:`DeploymentsOperations` + * 2024-05-01-preview: :class:`DeploymentsOperations` """ api_version = self._get_api_version('deployments') if api_version == '2020-07-01': @@ -1131,6 +1207,8 @@ def deployments(self): from ..v2023_12_01.aio.operations import DeploymentsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import DeploymentsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import DeploymentsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'deployments'".format(api_version)) self._config.api_version = api_version @@ -1149,6 +1227,7 @@ def dev_tool_portals(self): * 2023-11-01-preview: :class:`DevToolPortalsOperations` * 2023-12-01: :class:`DevToolPortalsOperations` * 2024-01-01-preview: :class:`DevToolPortalsOperations` + * 2024-05-01-preview: :class:`DevToolPortalsOperations` """ api_version = self._get_api_version('dev_tool_portals') if api_version == '2022-11-01-preview': @@ -1169,6 +1248,8 @@ def dev_tool_portals(self): from ..v2023_12_01.aio.operations import DevToolPortalsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import DevToolPortalsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import DevToolPortalsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'dev_tool_portals'".format(api_version)) self._config.api_version = api_version @@ -1183,6 +1264,7 @@ def eureka_servers(self): * 2023-09-01-preview: :class:`EurekaServersOperations` * 2023-11-01-preview: :class:`EurekaServersOperations` * 2024-01-01-preview: :class:`EurekaServersOperations` + * 2024-05-01-preview: :class:`EurekaServersOperations` """ api_version = self._get_api_version('eureka_servers') if api_version == '2023-05-01-preview': @@ -1195,6 +1277,8 @@ def eureka_servers(self): from ..v2023_11_01_preview.aio.operations import EurekaServersOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import EurekaServersOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import EurekaServersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'eureka_servers'".format(api_version)) self._config.api_version = api_version @@ -1218,6 +1302,7 @@ def gateway_custom_domains(self): * 2023-11-01-preview: :class:`GatewayCustomDomainsOperations` * 2023-12-01: :class:`GatewayCustomDomainsOperations` * 2024-01-01-preview: :class:`GatewayCustomDomainsOperations` + * 2024-05-01-preview: :class:`GatewayCustomDomainsOperations` """ api_version = self._get_api_version('gateway_custom_domains') if api_version == '2022-01-01-preview': @@ -1248,6 +1333,8 @@ def gateway_custom_domains(self): from ..v2023_12_01.aio.operations import GatewayCustomDomainsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import GatewayCustomDomainsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import GatewayCustomDomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gateway_custom_domains'".format(api_version)) self._config.api_version = api_version @@ -1271,6 +1358,7 @@ def gateway_route_configs(self): * 2023-11-01-preview: :class:`GatewayRouteConfigsOperations` * 2023-12-01: :class:`GatewayRouteConfigsOperations` * 2024-01-01-preview: :class:`GatewayRouteConfigsOperations` + * 2024-05-01-preview: :class:`GatewayRouteConfigsOperations` """ api_version = self._get_api_version('gateway_route_configs') if api_version == '2022-01-01-preview': @@ -1301,6 +1389,8 @@ def gateway_route_configs(self): from ..v2023_12_01.aio.operations import GatewayRouteConfigsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import GatewayRouteConfigsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import GatewayRouteConfigsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gateway_route_configs'".format(api_version)) self._config.api_version = api_version @@ -1324,6 +1414,7 @@ def gateways(self): * 2023-11-01-preview: :class:`GatewaysOperations` * 2023-12-01: :class:`GatewaysOperations` * 2024-01-01-preview: :class:`GatewaysOperations` + * 2024-05-01-preview: :class:`GatewaysOperations` """ api_version = self._get_api_version('gateways') if api_version == '2022-01-01-preview': @@ -1354,11 +1445,69 @@ def gateways(self): from ..v2023_12_01.aio.operations import GatewaysOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import GatewaysOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import GatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gateways'".format(api_version)) self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + @property + def job(self): + """Instance depends on the API version: + + * 2024-05-01-preview: :class:`JobOperations` + """ + api_version = self._get_api_version('job') + if api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import JobOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'job'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + + @property + def job_execution(self): + """Instance depends on the API version: + + * 2024-05-01-preview: :class:`JobExecutionOperations` + """ + api_version = self._get_api_version('job_execution') + if api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import JobExecutionOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'job_execution'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + + @property + def job_executions(self): + """Instance depends on the API version: + + * 2024-05-01-preview: :class:`JobExecutionsOperations` + """ + api_version = self._get_api_version('job_executions') + if api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import JobExecutionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'job_executions'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + + @property + def jobs(self): + """Instance depends on the API version: + + * 2024-05-01-preview: :class:`JobsOperations` + """ + api_version = self._get_api_version('jobs') + if api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import JobsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'jobs'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + @property def monitoring_settings(self): """Instance depends on the API version: @@ -1382,6 +1531,7 @@ def monitoring_settings(self): * 2023-11-01-preview: :class:`MonitoringSettingsOperations` * 2023-12-01: :class:`MonitoringSettingsOperations` * 2024-01-01-preview: :class:`MonitoringSettingsOperations` + * 2024-05-01-preview: :class:`MonitoringSettingsOperations` """ api_version = self._get_api_version('monitoring_settings') if api_version == '2020-07-01': @@ -1422,6 +1572,8 @@ def monitoring_settings(self): from ..v2023_12_01.aio.operations import MonitoringSettingsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import MonitoringSettingsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import MonitoringSettingsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'monitoring_settings'".format(api_version)) self._config.api_version = api_version @@ -1450,6 +1602,7 @@ def operations(self): * 2023-11-01-preview: :class:`Operations` * 2023-12-01: :class:`Operations` * 2024-01-01-preview: :class:`Operations` + * 2024-05-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2020-07-01': @@ -1490,6 +1643,8 @@ def operations(self): from ..v2023_12_01.aio.operations import Operations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import Operations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) self._config.api_version = api_version @@ -1508,6 +1663,7 @@ def predefined_accelerators(self): * 2023-11-01-preview: :class:`PredefinedAcceleratorsOperations` * 2023-12-01: :class:`PredefinedAcceleratorsOperations` * 2024-01-01-preview: :class:`PredefinedAcceleratorsOperations` + * 2024-05-01-preview: :class:`PredefinedAcceleratorsOperations` """ api_version = self._get_api_version('predefined_accelerators') if api_version == '2022-11-01-preview': @@ -1528,6 +1684,8 @@ def predefined_accelerators(self): from ..v2023_12_01.aio.operations import PredefinedAcceleratorsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import PredefinedAcceleratorsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import PredefinedAcceleratorsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'predefined_accelerators'".format(api_version)) self._config.api_version = api_version @@ -1556,6 +1714,7 @@ def runtime_versions(self): * 2023-11-01-preview: :class:`RuntimeVersionsOperations` * 2023-12-01: :class:`RuntimeVersionsOperations` * 2024-01-01-preview: :class:`RuntimeVersionsOperations` + * 2024-05-01-preview: :class:`RuntimeVersionsOperations` """ api_version = self._get_api_version('runtime_versions') if api_version == '2020-07-01': @@ -1596,6 +1755,8 @@ def runtime_versions(self): from ..v2023_12_01.aio.operations import RuntimeVersionsOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import RuntimeVersionsOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import RuntimeVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'runtime_versions'".format(api_version)) self._config.api_version = api_version @@ -1620,6 +1781,7 @@ def service_registries(self): * 2023-11-01-preview: :class:`ServiceRegistriesOperations` * 2023-12-01: :class:`ServiceRegistriesOperations` * 2024-01-01-preview: :class:`ServiceRegistriesOperations` + * 2024-05-01-preview: :class:`ServiceRegistriesOperations` """ api_version = self._get_api_version('service_registries') if api_version == '2022-01-01-preview': @@ -1652,6 +1814,8 @@ def service_registries(self): from ..v2023_12_01.aio.operations import ServiceRegistriesOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import ServiceRegistriesOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import ServiceRegistriesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'service_registries'".format(api_version)) self._config.api_version = api_version @@ -1680,6 +1844,7 @@ def services(self): * 2023-11-01-preview: :class:`ServicesOperations` * 2023-12-01: :class:`ServicesOperations` * 2024-01-01-preview: :class:`ServicesOperations` + * 2024-05-01-preview: :class:`ServicesOperations` """ api_version = self._get_api_version('services') if api_version == '2020-07-01': @@ -1720,6 +1885,8 @@ def services(self): from ..v2023_12_01.aio.operations import ServicesOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import ServicesOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import ServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'services'".format(api_version)) self._config.api_version = api_version @@ -1748,6 +1915,7 @@ def skus(self): * 2023-11-01-preview: :class:`SkusOperations` * 2023-12-01: :class:`SkusOperations` * 2024-01-01-preview: :class:`SkusOperations` + * 2024-05-01-preview: :class:`SkusOperations` """ api_version = self._get_api_version('skus') if api_version == '2020-07-01': @@ -1788,6 +1956,8 @@ def skus(self): from ..v2023_12_01.aio.operations import SkusOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import SkusOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import SkusOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'skus'".format(api_version)) self._config.api_version = api_version @@ -1812,6 +1982,7 @@ def storages(self): * 2023-11-01-preview: :class:`StoragesOperations` * 2023-12-01: :class:`StoragesOperations` * 2024-01-01-preview: :class:`StoragesOperations` + * 2024-05-01-preview: :class:`StoragesOperations` """ api_version = self._get_api_version('storages') if api_version == '2021-09-01-preview': @@ -1844,6 +2015,8 @@ def storages(self): from ..v2023_12_01.aio.operations import StoragesOperations as OperationClass elif api_version == '2024-01-01-preview': from ..v2024_01_01_preview.aio.operations import StoragesOperations as OperationClass + elif api_version == '2024-05-01-preview': + from ..v2024_05_01_preview.aio.operations import StoragesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'storages'".format(api_version)) self._config.api_version = api_version diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/aio/_configuration.py index e00835976b4..8b9db52738f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/aio/_configuration.py @@ -10,7 +10,6 @@ # -------------------------------------------------------------------------- from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -20,7 +19,7 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): +class AppPlatformManagementClientConfiguration: """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -42,12 +41,12 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'azure-mgmt-appplatform/{}'.format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/_app_platform_management_client.py index 2035702cd1c..473f317a3ef 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -85,7 +87,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -115,7 +135,7 @@ def __init__( ) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize, "2020-07-01") - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -135,7 +155,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/_configuration.py index 2f099242b71..bab9c551ea1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2020-07-01") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/_app_platform_management_client.py index 99a380eaa47..a681efe8f62 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -87,7 +89,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -117,7 +137,9 @@ def __init__( ) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize, "2020-07-01") - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -137,7 +159,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/_configuration.py index 5eea366adba..a43418bb9e2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2020-07-01") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_apps_operations.py index 5e431d846bc..60ac91ca7f2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -85,7 +85,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -104,23 +103,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,20 +130,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -171,7 +165,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -180,16 +174,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -212,10 +205,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -262,7 +243,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -277,18 +258,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -302,7 +275,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -315,19 +288,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2020_07_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2020_07_01.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -361,7 +323,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -374,17 +336,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -403,22 +363,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,11 +387,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -447,14 +402,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -482,7 +429,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -494,24 +441,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -537,7 +480,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -546,16 +489,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -575,10 +517,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -604,14 +542,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -625,7 +555,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -640,18 +570,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -665,7 +587,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -677,20 +599,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2020_07_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2020_07_01.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -724,7 +635,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -737,17 +648,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -758,7 +667,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.AppResource] @@ -781,17 +689,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -802,14 +709,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -819,11 +726,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -835,10 +742,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -852,7 +755,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -871,22 +773,21 @@ async def get_resource_upload_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -898,13 +799,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore @overload async def validate_domain( @@ -931,7 +828,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -943,7 +839,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -958,11 +854,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -974,7 +869,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -987,13 +882,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1021,7 +912,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1030,16 +921,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1051,10 +941,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_bindings_operations.py index 2199ef55777..c939fbc3fb5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,23 +96,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,13 +123,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -139,7 +133,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -239,14 +228,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -261,7 +242,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -278,18 +259,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -304,7 +277,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -319,19 +292,8 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2020_07_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + BindingResource type or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2020_07_01.models.BindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -366,7 +328,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -379,17 +341,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -408,23 +368,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,11 +393,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -455,14 +410,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -491,7 +438,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -503,17 +450,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -521,7 +464,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -547,7 +490,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -557,16 +500,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -586,10 +528,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -618,14 +556,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -640,7 +570,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -657,18 +587,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -683,7 +605,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -698,19 +620,8 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2020_07_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2020_07_01.models.BindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -745,7 +656,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -758,17 +669,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -783,7 +692,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.BindingResource] @@ -806,18 +714,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -828,14 +735,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -845,11 +752,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -860,7 +767,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_certificates_operations.py index 4dfa5ca72bf..4595140ecb7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -94,22 +93,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,20 +119,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -160,7 +154,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -169,16 +163,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -201,10 +194,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -230,14 +219,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -251,7 +232,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -266,18 +247,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -291,7 +264,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -304,20 +277,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: ~azure.mgmt.appplatform.v2020_07_01.models.CertificateResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -351,7 +313,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -364,17 +326,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -393,22 +353,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -418,11 +377,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -437,14 +392,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -472,7 +419,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -484,17 +431,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -507,7 +450,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.CertificateResource] @@ -530,17 +472,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -551,14 +492,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -568,11 +509,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -583,7 +524,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_config_servers_operations.py index 2d3bb3eace0..951b17c3cc4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -87,21 +86,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -113,19 +111,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -151,7 +145,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -159,16 +153,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -188,10 +181,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -214,14 +203,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -234,7 +215,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -247,18 +228,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -271,7 +244,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -282,20 +255,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -328,7 +290,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -341,23 +303,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -383,7 +343,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -391,16 +351,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -420,10 +379,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -446,14 +401,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -466,7 +413,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -479,18 +426,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -503,7 +442,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -514,20 +453,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -560,7 +488,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -573,23 +501,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -615,7 +541,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -623,16 +549,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -652,10 +577,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -678,14 +599,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -698,7 +611,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -711,18 +624,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -735,7 +640,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -746,20 +651,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -792,7 +686,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -804,14 +698,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_custom_domains_operations.py index 73a859702f2..12fc7fd8874 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,23 +96,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,13 +123,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -139,7 +133,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -239,14 +228,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -261,7 +242,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -278,18 +259,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -304,7 +277,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -319,19 +292,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -366,7 +329,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -379,17 +342,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -408,23 +369,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,11 +394,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -455,14 +411,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -491,7 +439,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -503,17 +451,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -521,7 +465,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -547,7 +491,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -557,16 +501,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -586,10 +529,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -618,14 +557,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -640,7 +571,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -657,18 +588,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -683,7 +606,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -698,19 +621,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -745,7 +658,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -758,17 +671,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -783,7 +694,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -807,18 +717,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -829,14 +738,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -846,11 +755,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -861,7 +770,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_deployments_operations.py index b1e9914e63b..dec35cc8635 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -83,7 +83,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -102,23 +101,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -130,13 +128,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -144,7 +138,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -170,7 +164,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -180,16 +174,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -212,10 +205,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -244,14 +233,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -266,7 +247,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -283,18 +264,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -309,7 +282,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -324,19 +297,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + DeploymentResource type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -371,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -384,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -413,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +416,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -496,7 +444,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -508,17 +456,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +470,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -552,7 +496,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -562,16 +506,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -591,10 +534,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -623,14 +562,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -645,7 +576,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -662,18 +593,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -688,7 +611,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -703,19 +626,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -750,7 +663,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -763,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -795,7 +706,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource] @@ -818,19 +728,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -841,14 +750,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -858,11 +767,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -874,10 +783,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -891,7 +796,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource] @@ -914,18 +818,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -936,14 +839,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -953,11 +856,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -969,10 +872,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -990,23 +889,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1016,11 +914,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1037,14 +931,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1073,7 +959,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1085,17 +971,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1114,23 +996,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1140,11 +1021,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1161,14 +1038,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1197,7 +1066,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1209,17 +1078,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1238,23 +1103,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1264,11 +1128,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1285,14 +1145,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1321,7 +1173,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1333,17 +1185,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1360,7 +1208,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1379,23 +1226,22 @@ async def get_log_file_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1409,10 +1255,6 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_monitoring_settings_operations.py index d284e7101cc..7f1a63f22e0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -88,21 +87,20 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -114,19 +112,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -152,7 +146,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -160,16 +154,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -189,10 +182,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -216,14 +205,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -236,7 +217,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -249,18 +230,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -273,7 +246,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -284,20 +257,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -330,7 +292,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -343,23 +305,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -385,7 +345,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -393,16 +353,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +381,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -449,14 +404,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -469,7 +416,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -482,18 +429,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -506,7 +445,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -517,20 +456,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -563,7 +491,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -576,14 +504,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_operations.py index 4a98016b56d..71a03890927 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.OperationDetail] @@ -80,14 +79,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -98,14 +96,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -115,11 +113,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -130,5 +128,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_runtime_versions_operations.py index a4549c1b4a7..5b71bc6b091 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -74,18 +73,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -97,8 +95,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_services_operations.py index 716b41f19f9..95e494a3a2f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,21 +96,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,16 +121,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -157,7 +155,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -165,16 +163,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -197,10 +194,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -223,14 +216,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -243,7 +228,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -256,18 +241,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -277,7 +254,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -287,19 +268,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -332,7 +302,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -345,17 +315,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -374,21 +342,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -398,11 +365,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -413,14 +376,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -447,7 +402,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -459,20 +414,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -497,7 +452,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -505,16 +460,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -534,10 +488,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -560,14 +510,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -580,7 +522,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -593,18 +535,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -614,7 +548,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -623,20 +561,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -669,7 +596,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -682,17 +609,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -703,7 +628,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -722,21 +646,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -748,13 +671,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -779,7 +698,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -790,7 +708,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -803,11 +721,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -818,7 +735,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -829,13 +746,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2020_07_01.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2020_07_01.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -863,7 +776,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -871,16 +784,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -892,13 +804,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -911,7 +819,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -930,21 +837,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -954,11 +860,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -971,7 +873,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -990,21 +891,20 @@ async def enable_test_endpoint( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1016,13 +916,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore @overload async def check_name_availability( @@ -1043,7 +939,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1051,18 +946,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1070,20 +969,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2020_07_01.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2020_07_01.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1111,23 +1009,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1139,19 +1036,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource] @@ -1174,15 +1066,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1193,14 +1084,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1210,11 +1101,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1226,8 +1117,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1235,7 +1124,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource] @@ -1258,16 +1146,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1278,14 +1165,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1295,11 +1182,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1310,7 +1197,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_skus_operations.py index 78703dca62c..f6d530b337d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.ResourceSku] @@ -80,15 +79,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -99,14 +97,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -116,11 +114,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -131,5 +129,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/models/_models_py3.py index a9ebf667e92..a79ea484224 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/models/_models_py3.py @@ -70,22 +70,6 @@ class ProxyResource(Resource): :vartype type: str """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class AppResource(ProxyResource): """App resource payload. @@ -451,7 +435,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar thumbprint: The thumbprint of certificate. :vartype thumbprint: str @@ -690,7 +674,7 @@ def __init__(self, *, network_profile: Optional["_models.NetworkProfile"] = None class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: list[~azure.mgmt.appplatform.v2020_07_01.models.GitPatternRepository] @@ -1063,7 +1047,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -1401,7 +1385,7 @@ def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -1503,7 +1487,7 @@ def __init__( class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -1878,7 +1862,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -2179,7 +2163,7 @@ def __init__(self, *, size_in_gb: Optional[int] = None, mount_path: Optional[str class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2020_07_01.models.TestKeyType @@ -2772,7 +2756,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_apps_operations.py index e272155cfa5..44e9a781357 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -317,7 +317,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -336,23 +335,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -364,20 +362,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -403,7 +397,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -412,16 +406,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -444,10 +437,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -473,14 +462,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2020_07_01.models.AppResource] @@ -493,7 +474,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -508,18 +489,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2020_07_01.models.AppResource] @@ -532,7 +505,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -545,19 +518,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2020_07_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2020_07_01.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2020_07_01.models.AppResource] @@ -590,7 +552,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -602,17 +564,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -631,22 +591,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -656,11 +615,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -675,14 +630,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -710,7 +657,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -721,24 +668,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -764,7 +707,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -773,16 +716,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -802,10 +744,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -831,14 +769,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2020_07_01.models.AppResource] @@ -851,7 +781,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -866,18 +796,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2020_07_01.models.AppResource] @@ -890,7 +812,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -902,20 +824,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2020_07_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2020_07_01.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2020_07_01.models.AppResource] @@ -948,7 +859,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -960,17 +871,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -981,7 +890,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.AppResource] :raises ~azure.core.exceptions.HttpResponseError: @@ -1003,17 +911,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1024,14 +931,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1041,11 +948,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1057,10 +964,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1074,7 +977,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1093,22 +995,21 @@ def get_resource_upload_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1120,13 +1021,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore @overload def validate_domain( @@ -1153,7 +1050,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1165,7 +1061,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1180,11 +1076,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1196,7 +1091,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1209,13 +1104,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1243,7 +1134,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1252,16 +1143,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1273,10 +1163,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_bindings_operations.py index 9d93eee92d3..ce5895a3d95 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -263,23 +262,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,13 +289,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -305,7 +299,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -331,7 +325,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -341,16 +335,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -373,10 +366,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -405,14 +394,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -427,7 +408,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -444,18 +425,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -470,7 +443,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -485,19 +458,8 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2020_07_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + BindingResource type or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2020_07_01.models.BindingResource or IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -532,7 +494,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -544,17 +506,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -573,23 +533,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,11 +558,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -620,14 +575,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -656,7 +603,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -667,17 +614,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -685,7 +628,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -711,7 +654,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -721,16 +664,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -750,10 +692,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -782,14 +720,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -804,7 +734,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -821,18 +751,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -847,7 +769,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -862,19 +784,8 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2020_07_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2020_07_01.models.BindingResource or IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -909,7 +820,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -921,17 +832,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -946,7 +855,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.BindingResource] @@ -969,18 +877,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -991,14 +898,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1008,11 +915,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1023,7 +930,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_certificates_operations.py index 99b4528745f..f27e81f1227 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -219,22 +218,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -246,20 +244,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -285,7 +279,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -294,16 +288,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -326,10 +319,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -355,14 +344,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -376,7 +357,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -391,18 +372,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -416,7 +389,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -429,20 +402,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: ~azure.mgmt.appplatform.v2020_07_01.models.CertificateResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -476,7 +438,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -488,17 +450,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -517,22 +477,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -542,11 +501,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -561,14 +516,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -596,7 +543,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -607,17 +554,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -630,7 +573,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.CertificateResource] @@ -653,17 +595,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -674,14 +615,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -691,11 +632,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -706,7 +647,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_config_servers_operations.py index 51243837144..4718c72935e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -216,21 +215,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -242,19 +240,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -280,7 +274,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -288,16 +282,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -317,10 +310,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -343,14 +332,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +357,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -400,7 +373,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -411,20 +384,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -457,7 +419,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -469,23 +431,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -511,7 +471,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -519,16 +479,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,10 +507,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -574,14 +529,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -594,7 +541,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -607,18 +554,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -631,7 +570,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -642,20 +581,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -688,7 +616,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -700,23 +628,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -742,7 +668,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -750,16 +676,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -779,10 +704,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -805,14 +726,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -825,7 +738,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -838,18 +751,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -862,7 +767,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -873,20 +778,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -919,7 +813,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,14 +825,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_custom_domains_operations.py index e1d8430e454..92711dd1074 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -263,23 +262,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,13 +289,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -305,7 +299,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -331,7 +325,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -341,16 +335,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -373,10 +366,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -405,14 +394,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -427,7 +408,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -444,18 +425,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -470,7 +443,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -485,19 +458,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource or + IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -532,7 +495,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -544,17 +507,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -573,23 +534,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,11 +559,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -620,14 +576,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -656,7 +604,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -667,17 +615,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -685,7 +629,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -711,7 +655,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -721,16 +665,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -750,10 +693,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -782,14 +721,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -804,7 +735,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -821,18 +752,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -847,7 +770,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -862,19 +785,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource or + IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -909,7 +822,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -921,17 +834,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -946,7 +857,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -970,18 +880,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -992,14 +901,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1009,11 +918,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1024,7 +933,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_deployments_operations.py index a08d0d45dd1..231aea0baae 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -462,7 +462,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -481,23 +480,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -509,13 +507,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -523,7 +517,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -549,7 +543,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -559,16 +553,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -591,10 +584,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -623,14 +612,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -645,7 +626,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -662,18 +643,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -688,7 +661,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -703,19 +676,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + DeploymentResource type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource or + IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -750,7 +713,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -762,17 +725,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -791,23 +752,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -817,11 +777,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -838,14 +794,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -874,7 +822,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -885,17 +833,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -903,7 +847,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -929,7 +873,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -939,16 +883,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -968,10 +911,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1000,14 +939,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1022,7 +953,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1039,18 +970,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1065,7 +988,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1080,19 +1003,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource or + IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1127,7 +1040,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1139,17 +1052,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1171,7 +1082,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource] @@ -1194,19 +1104,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1217,14 +1126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1234,11 +1143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1250,10 +1159,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1267,7 +1172,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource] @@ -1290,18 +1194,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1312,14 +1215,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1329,11 +1232,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1345,10 +1248,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1366,23 +1265,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1392,11 +1290,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1413,14 +1307,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1449,7 +1335,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1460,17 +1346,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1489,23 +1371,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1515,11 +1396,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1536,14 +1413,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1572,7 +1441,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1583,17 +1452,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1612,23 +1477,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1638,11 +1502,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1659,14 +1519,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1695,7 +1547,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1706,17 +1558,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def get_log_file_url( @@ -1733,7 +1581,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1752,23 +1599,22 @@ def get_log_file_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1782,10 +1628,6 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_monitoring_settings_operations.py index b6e2153039b..6ee26121eae 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -182,21 +181,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,19 +206,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -246,7 +240,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -254,16 +248,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,10 +276,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -310,14 +299,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -330,7 +311,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -343,18 +324,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -367,7 +340,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -378,20 +351,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -424,7 +386,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -436,23 +398,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -478,7 +438,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -486,16 +446,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -515,10 +474,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -542,14 +497,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -562,7 +509,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -575,18 +522,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -599,7 +538,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -610,20 +549,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -656,7 +584,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -668,14 +596,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_operations.py index f3b2517c2f7..64be21dc6d5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.OperationDetail] @@ -102,14 +101,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -137,11 +135,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -152,5 +150,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_runtime_versions_operations.py index c4892446dfe..04ef0f9e0f2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -96,18 +95,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -119,8 +117,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_services_operations.py index d58895c077a..a3f568fb9d3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -406,7 +406,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -425,21 +424,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -451,16 +449,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -485,7 +483,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -493,16 +491,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -525,10 +522,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -551,14 +544,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -571,7 +556,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -584,18 +569,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -605,7 +582,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -615,19 +596,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -660,7 +630,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -672,17 +642,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -701,21 +669,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -725,11 +692,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -740,14 +703,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -774,7 +729,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -785,20 +740,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -823,7 +778,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -831,16 +786,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -860,10 +814,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -886,14 +836,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -906,7 +848,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -919,18 +861,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -940,7 +874,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -949,20 +887,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -995,7 +922,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1007,17 +934,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1028,7 +953,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1047,21 +971,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1073,13 +996,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1104,7 +1023,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1115,7 +1033,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1128,11 +1046,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1143,7 +1060,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1154,13 +1071,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2020_07_01.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2020_07_01.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1188,7 +1101,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1196,16 +1109,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1217,13 +1129,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1236,7 +1144,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1255,21 +1162,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1279,11 +1185,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1294,7 +1196,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1313,21 +1214,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1339,13 +1239,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore @overload def check_name_availability( @@ -1366,7 +1262,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1374,18 +1269,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1393,20 +1292,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2020_07_01.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2020_07_01.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1434,23 +1332,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1462,19 +1359,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource] @@ -1497,15 +1389,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1516,14 +1407,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1533,11 +1424,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1549,8 +1440,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1558,7 +1447,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource] @@ -1581,16 +1469,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1601,14 +1488,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1618,11 +1505,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1633,7 +1520,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_skus_operations.py index 4d75884e692..760e0316809 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_07_01/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_07_01.models.ResourceSku] :raises ~azure.core.exceptions.HttpResponseError: @@ -106,15 +105,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -125,14 +123,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -142,11 +140,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,5 +155,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/_app_platform_management_client.py index 6455a985dea..9130ed49b2a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -89,7 +91,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -125,7 +145,7 @@ def __init__( ) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize, "2020-11-01-preview") - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -145,7 +165,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/_configuration.py index 9395391937a..2278507dcf8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2020-11-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/_app_platform_management_client.py index c5d5c12f041..d11b9fc33b8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -89,7 +91,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -125,7 +145,9 @@ def __init__( ) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize, "2020-11-01-preview") - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -145,7 +167,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/_configuration.py index abf8b4c0186..e4804acf7a6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2020-11-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_apps_operations.py index 4aaeae959ec..4d595ee1f79 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -85,7 +85,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -106,23 +105,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -134,20 +132,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -175,7 +169,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -184,16 +178,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -216,10 +209,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -245,14 +234,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -266,7 +247,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -306,7 +279,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -319,19 +292,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -367,7 +329,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -380,17 +342,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -411,22 +371,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -436,11 +395,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -455,14 +410,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -492,7 +439,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -504,24 +451,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -549,7 +492,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -558,16 +501,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -587,10 +529,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -616,14 +554,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -637,7 +567,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -652,18 +582,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -677,7 +599,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -689,20 +611,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -738,7 +649,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -751,17 +662,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -772,7 +681,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource] @@ -797,17 +705,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -818,14 +725,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -835,11 +742,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -851,10 +758,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -868,7 +771,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -889,22 +791,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -916,13 +817,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore @overload async def validate_domain( @@ -950,7 +847,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -962,7 +858,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -977,11 +873,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -993,7 +888,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1006,13 +901,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1042,7 +933,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1051,16 +942,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1072,10 +962,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_bindings_operations.py index f81c1737a81..7a88cde89e6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -386,17 +348,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -417,23 +377,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -443,11 +402,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -464,14 +419,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -502,7 +449,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -514,17 +461,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -532,7 +475,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -560,7 +503,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -570,16 +513,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,10 +541,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -631,14 +569,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -653,7 +583,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -670,18 +600,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -696,7 +618,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -711,20 +633,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -761,7 +672,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -774,17 +685,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -799,7 +708,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResource] @@ -824,18 +732,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -846,14 +753,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -863,11 +770,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -878,7 +785,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_certificates_operations.py index 7423b4b8537..db107ede4d4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -371,17 +333,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -402,22 +362,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,11 +386,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -446,14 +401,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -483,7 +430,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -495,17 +442,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -518,7 +461,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateResource] @@ -543,17 +485,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +505,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -581,11 +522,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +537,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_config_servers_operations.py index d28e19d92a9..8bbc2cb1088 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -348,23 +310,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -392,7 +352,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -400,16 +360,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,10 +388,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -456,14 +411,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -476,7 +423,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -489,18 +436,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -513,7 +452,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -524,20 +463,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -572,7 +500,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,23 +513,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -629,7 +555,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -637,16 +563,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -666,10 +591,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -693,14 +614,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -713,7 +626,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -726,18 +639,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -750,7 +655,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -761,20 +666,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -809,7 +703,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -821,14 +715,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_custom_domains_operations.py index c78da045e5a..42dedff8785 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -386,17 +348,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -417,23 +377,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -443,11 +402,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -464,14 +419,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -502,7 +449,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -514,17 +461,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -532,7 +475,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -560,7 +503,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -570,16 +513,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,10 +541,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -631,14 +569,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -653,7 +583,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -670,18 +600,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -696,7 +618,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -711,20 +633,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -761,7 +672,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -774,17 +685,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -799,7 +708,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -825,18 +733,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -847,14 +754,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -864,11 +771,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -879,7 +786,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_deployments_operations.py index 3b7c0054a30..727455bb747 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -83,7 +83,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -104,23 +103,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,13 +130,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -146,7 +140,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -174,7 +168,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -184,16 +178,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -216,10 +209,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -249,14 +238,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -271,7 +252,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -288,18 +269,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -314,7 +287,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -329,20 +302,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -379,7 +341,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -392,17 +354,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -423,23 +383,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,11 +408,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -470,14 +425,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -508,7 +455,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -520,17 +467,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -538,7 +481,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -566,7 +509,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -576,16 +519,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -605,10 +547,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -638,14 +576,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -660,7 +590,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -677,18 +607,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -703,7 +625,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -718,20 +640,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -768,7 +679,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -781,17 +692,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -813,7 +722,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource] @@ -838,19 +746,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -861,14 +768,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -878,11 +785,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -894,10 +801,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -911,7 +814,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource] @@ -936,18 +838,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -958,14 +859,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -975,11 +876,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -991,10 +892,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1014,23 +911,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1040,11 +936,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1061,14 +953,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1099,7 +983,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1111,17 +995,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1142,23 +1022,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1168,11 +1047,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1189,14 +1064,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1227,7 +1094,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1239,17 +1106,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1270,23 +1133,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1296,11 +1158,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1317,14 +1175,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1355,7 +1205,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1367,17 +1217,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1394,7 +1240,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1415,23 +1260,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1445,10 +1289,6 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_monitoring_settings_operations.py index cebdc945ca5..93934d5916a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -349,23 +311,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -393,7 +353,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -401,16 +361,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -430,10 +389,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -457,14 +412,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -477,7 +424,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -490,18 +437,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -514,7 +453,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -525,20 +464,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -573,7 +501,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +514,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_operations.py index ffba26183a6..6014be2050b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_runtime_versions_operations.py index 38d812c36f0..4138cf17358 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_services_operations.py index c49c36e4975..211ad9edbae 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,21 +98,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,16 +123,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -161,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -169,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -201,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -227,14 +220,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -247,7 +232,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -260,18 +245,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -281,7 +258,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -291,19 +272,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -338,7 +308,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -351,17 +321,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -382,21 +350,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -406,11 +373,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -421,14 +384,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -457,7 +412,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -469,20 +424,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -509,7 +464,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -517,16 +472,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -546,10 +500,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -572,14 +522,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -592,7 +534,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -605,18 +547,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -626,7 +560,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -635,20 +573,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -683,7 +610,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -696,17 +623,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -717,7 +642,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -738,21 +662,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -764,13 +687,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -795,7 +714,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -806,7 +724,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -819,11 +737,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -834,7 +751,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -845,13 +762,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2020_11_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -881,7 +794,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -889,16 +802,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -910,13 +822,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -929,7 +837,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -950,21 +857,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -974,11 +880,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -991,7 +893,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1012,21 +913,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1038,13 +938,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore @overload async def check_name_availability( @@ -1065,7 +961,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1073,18 +968,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1092,20 +991,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2020_11_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1135,23 +1033,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1163,19 +1060,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource] @@ -1200,15 +1092,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1219,14 +1110,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1236,11 +1127,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1252,8 +1143,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1261,7 +1150,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource] @@ -1286,16 +1174,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1306,14 +1193,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1323,11 +1210,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1338,7 +1225,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_skus_operations.py index 8867de7b016..e3da2e05643 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/models/_models_py3.py index af9f7e16032..57f3ed1e712 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/models/_models_py3.py @@ -93,22 +93,6 @@ class ProxyResource(Resource): :vartype type: str """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class AppResource(ProxyResource): """App resource payload. @@ -485,7 +469,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar thumbprint: The thumbprint of certificate. :vartype thumbprint: str @@ -724,7 +708,7 @@ def __init__(self, *, network_profile: Optional["_models.NetworkProfile"] = None class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -1104,7 +1088,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -1449,7 +1433,7 @@ def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -1551,7 +1535,7 @@ def __init__( class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -1953,7 +1937,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -2257,7 +2241,7 @@ def __init__(self, *, size_in_gb: Optional[int] = None, mount_path: Optional[str class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeyType @@ -2858,7 +2842,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_apps_operations.py index a46b001df34..a7b44a81d85 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -317,7 +317,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -338,23 +337,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -366,20 +364,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -407,7 +401,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -416,16 +410,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -448,10 +441,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -477,14 +466,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -498,7 +479,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -513,18 +494,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -538,7 +511,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -551,19 +524,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -599,7 +561,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -611,17 +573,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -642,22 +602,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -667,11 +626,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -686,14 +641,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -723,7 +670,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -734,24 +681,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -779,7 +722,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -788,16 +731,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -817,10 +759,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -846,14 +784,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -867,7 +797,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -882,18 +812,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -907,7 +829,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -919,20 +841,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -968,7 +879,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -980,17 +891,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1001,7 +910,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.AppResource] @@ -1026,17 +934,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1047,14 +954,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1064,11 +971,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1080,10 +987,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1097,7 +1000,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1118,22 +1020,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1145,13 +1046,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore @overload def validate_domain( @@ -1179,7 +1076,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1191,7 +1087,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1206,11 +1102,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1222,7 +1117,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1235,13 +1130,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1271,7 +1162,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1280,16 +1171,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1301,10 +1191,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_bindings_operations.py index f130069db7d..7348648cd4d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -551,17 +513,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -582,23 +542,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,11 +567,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -629,14 +584,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -667,7 +614,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -678,17 +625,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -696,7 +639,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -724,7 +667,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -734,16 +677,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -763,10 +705,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -795,14 +733,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -817,7 +747,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -834,18 +764,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -860,7 +782,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -875,20 +797,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -925,7 +836,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -937,17 +848,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -962,7 +871,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.BindingResource] @@ -987,18 +895,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1009,14 +916,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1026,11 +933,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1041,7 +948,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_certificates_operations.py index 34144767853..6a8e5713e02 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -495,17 +457,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -526,22 +486,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -551,11 +510,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -570,14 +525,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -607,7 +554,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -618,17 +565,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -641,7 +584,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.CertificateResource] @@ -666,17 +608,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -687,14 +628,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -704,11 +645,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -719,7 +660,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_config_servers_operations.py index bec50f60c93..7336b6ecfee 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -476,23 +438,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -520,7 +480,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -528,16 +488,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -557,10 +516,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -584,14 +539,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -604,7 +551,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -617,18 +564,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -641,7 +580,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -652,20 +591,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -700,7 +628,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -712,23 +640,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -756,7 +682,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -764,16 +690,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,10 +718,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -820,14 +741,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -840,7 +753,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -853,18 +766,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -877,7 +782,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -888,20 +793,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -936,7 +830,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -948,14 +842,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_custom_domains_operations.py index 87b50e73bbc..db79e23f24b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -551,17 +513,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -582,23 +542,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,11 +567,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -629,14 +584,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -667,7 +614,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -678,17 +625,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -696,7 +639,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -724,7 +667,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -734,16 +677,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -763,10 +705,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -795,14 +733,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -817,7 +747,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -834,18 +764,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -860,7 +782,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -875,20 +797,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -925,7 +836,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -937,17 +848,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -962,7 +871,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -988,18 +896,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1010,14 +917,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1027,11 +934,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1042,7 +949,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_deployments_operations.py index 1ee1a03aefb..2745cacb62f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -462,7 +462,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -483,23 +482,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -511,13 +509,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -525,7 +519,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -553,7 +547,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -563,16 +557,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -595,10 +588,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -628,14 +617,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -650,7 +631,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -667,18 +648,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -693,7 +666,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -708,20 +681,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -758,7 +720,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -770,17 +732,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -801,23 +761,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -827,11 +786,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -848,14 +803,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -886,7 +833,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -897,17 +844,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -915,7 +858,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -943,7 +886,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -953,16 +896,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -982,10 +924,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1015,14 +953,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1037,7 +967,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1054,18 +984,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1080,7 +1002,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1095,20 +1017,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1145,7 +1056,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1157,17 +1068,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1189,7 +1098,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource] @@ -1214,19 +1122,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1237,14 +1144,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1254,11 +1161,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1270,10 +1177,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1287,7 +1190,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.DeploymentResource] @@ -1312,18 +1214,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1334,14 +1235,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1351,11 +1252,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1367,10 +1268,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1390,23 +1287,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1416,11 +1312,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1437,14 +1329,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1475,7 +1359,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1486,17 +1370,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1517,23 +1397,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1543,11 +1422,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1564,14 +1439,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1602,7 +1469,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1613,17 +1480,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1644,23 +1507,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1670,11 +1532,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1691,14 +1549,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1729,7 +1579,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1740,17 +1590,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def get_log_file_url( @@ -1767,7 +1613,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1788,23 +1633,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1818,10 +1662,6 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_monitoring_settings_operations.py index c3129beb14f..cadce0f8840 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -442,23 +404,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -486,7 +446,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -494,16 +454,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -523,10 +482,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -550,14 +505,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +517,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -583,18 +530,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -607,7 +546,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -618,20 +557,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2020_11_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -666,7 +594,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -678,14 +606,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_operations.py index fa1aa118134..4d8e05a9620 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_runtime_versions_operations.py index 25e72721d8a..64148a740f8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_services_operations.py index 3943ae33e66..d4088ecfe2d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -406,7 +406,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -427,21 +426,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -453,16 +451,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -489,7 +487,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -497,16 +495,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -529,10 +526,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -555,14 +548,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -575,7 +560,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -588,18 +573,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -609,7 +586,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -619,19 +600,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -666,7 +636,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -678,17 +648,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -709,21 +677,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -733,11 +700,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -748,14 +711,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -784,7 +739,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -795,20 +750,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -835,7 +790,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -843,16 +798,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -872,10 +826,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -898,14 +848,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -918,7 +860,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -931,18 +873,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -952,7 +886,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -961,20 +899,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1009,7 +936,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1021,17 +948,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1042,7 +967,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1063,21 +987,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1089,13 +1012,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1120,7 +1039,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1131,7 +1049,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1144,11 +1062,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1159,7 +1076,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1170,13 +1087,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2020_11_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1206,7 +1119,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1214,16 +1127,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1235,13 +1147,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1254,7 +1162,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1275,21 +1182,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1299,11 +1205,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1314,7 +1216,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1335,21 +1236,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1361,13 +1261,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore @overload def check_name_availability( @@ -1388,7 +1284,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1396,18 +1291,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1415,20 +1314,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2020_11_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2020_11_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2020_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1458,23 +1356,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1486,19 +1383,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource] @@ -1523,15 +1415,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1542,14 +1433,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1559,11 +1450,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1575,8 +1466,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1584,7 +1473,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.ServiceResource] @@ -1609,16 +1497,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1629,14 +1516,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1646,11 +1533,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1661,7 +1548,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_skus_operations.py index 65d04df3f10..6093c9b0018 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2020_11_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2020_11_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/_app_platform_management_client.py index 780555ab265..1b8969bd839 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -89,7 +91,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -125,7 +145,7 @@ def __init__( ) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize, "2021-06-01-preview") - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -145,7 +165,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/_configuration.py index d8bf15444e8..ff5612f09b0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2021-06-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/_app_platform_management_client.py index ec8264c7fc6..61e4a4e5fb8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -89,7 +91,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -125,7 +145,9 @@ def __init__( ) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize, "2021-06-01-preview") - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -145,7 +167,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/_configuration.py index 09f7e0c749d..ebe69a311e1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2021-06-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_apps_operations.py index eb39dc94034..dc392276cc1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -85,7 +85,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -106,23 +105,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -134,20 +132,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -175,7 +169,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -184,16 +178,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -216,10 +209,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -245,14 +234,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -266,7 +247,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -306,7 +279,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -319,19 +292,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -367,7 +329,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -380,17 +342,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -411,22 +371,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -436,11 +395,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -455,14 +410,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -492,7 +439,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -504,24 +451,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -549,7 +492,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -558,16 +501,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -587,10 +529,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -616,14 +554,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -637,7 +567,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -652,18 +582,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -677,7 +599,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -689,20 +611,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -738,7 +649,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -751,17 +662,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -772,7 +681,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource] @@ -797,17 +705,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -818,14 +725,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -835,11 +742,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -851,10 +758,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -868,7 +771,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -889,22 +791,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -916,13 +817,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore @overload async def validate_domain( @@ -950,7 +847,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -962,7 +858,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -977,11 +873,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -993,7 +888,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1006,13 +901,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1042,7 +933,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1051,16 +942,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1072,10 +962,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_bindings_operations.py index 48cc4681bc8..7cd1388be3f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -386,17 +348,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -417,23 +377,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -443,11 +402,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -464,14 +419,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -502,7 +449,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -514,17 +461,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -532,7 +475,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -560,7 +503,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -570,16 +513,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,10 +541,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -631,14 +569,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -653,7 +583,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -670,18 +600,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -696,7 +618,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -711,20 +633,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -761,7 +672,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -774,17 +685,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -799,7 +708,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResource] @@ -824,18 +732,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -846,14 +753,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -863,11 +770,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -878,7 +785,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_certificates_operations.py index 40046755bc9..6d782baffcd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -371,17 +333,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -402,22 +362,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,11 +386,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -446,14 +401,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -483,7 +430,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -495,17 +442,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -518,7 +461,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateResource] @@ -543,17 +485,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +505,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -581,11 +522,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +537,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_config_servers_operations.py index 483f85b3e4c..0716966f728 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -348,23 +310,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -392,7 +352,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -400,16 +360,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,10 +388,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -456,14 +411,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -476,7 +423,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -489,18 +436,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -513,7 +452,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -524,20 +463,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -572,7 +500,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,23 +513,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -629,7 +555,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -637,16 +563,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -666,10 +591,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -693,14 +614,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -713,7 +626,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -726,18 +639,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -750,7 +655,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -761,20 +666,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -809,7 +703,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -821,14 +715,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_custom_domains_operations.py index d9ebbbe8abe..f1c4e1264e9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -386,17 +348,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -417,23 +377,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -443,11 +402,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -464,14 +419,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -502,7 +449,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -514,17 +461,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -532,7 +475,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -560,7 +503,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -570,16 +513,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,10 +541,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -631,14 +569,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -653,7 +583,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -670,18 +600,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -696,7 +618,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -711,20 +633,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -761,7 +672,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -774,17 +685,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -799,7 +708,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -825,18 +733,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -847,14 +754,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -864,11 +771,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -879,7 +786,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_deployments_operations.py index 6794789022c..0d0be84cc1f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -83,7 +83,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -104,23 +103,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,13 +130,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -146,7 +140,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -174,7 +168,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -184,16 +178,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -216,10 +209,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -249,14 +238,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -271,7 +252,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -288,18 +269,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -314,7 +287,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -329,20 +302,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -379,7 +341,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -392,17 +354,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -423,23 +383,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,11 +408,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -470,14 +425,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -508,7 +455,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -520,17 +467,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -538,7 +481,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -566,7 +509,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -576,16 +519,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -605,10 +547,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -638,14 +576,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -660,7 +590,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -677,18 +607,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -703,7 +625,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -718,20 +640,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -768,7 +679,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -781,17 +692,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -813,7 +722,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource] @@ -838,19 +746,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -861,14 +768,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -878,11 +785,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -894,10 +801,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -911,7 +814,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource] @@ -936,18 +838,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -958,14 +859,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -975,11 +876,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -991,10 +892,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1014,23 +911,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1040,11 +936,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1061,14 +953,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1099,7 +983,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1111,17 +995,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1142,23 +1022,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1168,11 +1047,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1189,14 +1064,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1227,7 +1094,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1239,17 +1106,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1270,23 +1133,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1296,11 +1158,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1317,14 +1175,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1355,7 +1205,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1367,17 +1217,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1394,7 +1240,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1415,23 +1260,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1445,10 +1289,6 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_monitoring_settings_operations.py index a99008b1343..738c890f3a3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -349,23 +311,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -393,7 +353,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -401,16 +361,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -430,10 +389,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -457,14 +412,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -477,7 +424,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -490,18 +437,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -514,7 +453,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -525,20 +464,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -573,7 +501,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +514,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_operations.py index eba2db4babc..e3c67364355 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_runtime_versions_operations.py index ce128bb29b0..2e215a36cac 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_services_operations.py index c1da29e181c..716a55088ec 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,21 +98,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,16 +123,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -161,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -169,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -201,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -227,14 +220,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -247,7 +232,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -260,18 +245,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -281,7 +258,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -291,19 +272,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -338,7 +308,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -351,17 +321,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -382,21 +350,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -406,11 +373,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -421,14 +384,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -457,7 +412,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -469,20 +424,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -509,7 +464,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -517,16 +472,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -546,10 +500,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -572,14 +522,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -592,7 +534,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -605,18 +547,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -626,7 +560,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -635,20 +573,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -683,7 +610,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -696,17 +623,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -717,7 +642,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -738,21 +662,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -764,13 +687,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -795,7 +714,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -806,7 +724,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -819,11 +737,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -834,7 +751,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -845,13 +762,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2021_06_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -881,7 +794,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -889,16 +802,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -910,13 +822,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -929,7 +837,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -950,21 +857,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -974,11 +880,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -991,7 +893,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1012,21 +913,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1038,13 +938,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore @overload async def check_name_availability( @@ -1065,7 +961,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1073,18 +968,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1092,20 +991,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2021_06_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1135,23 +1033,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1163,19 +1060,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource] @@ -1200,15 +1092,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1219,14 +1110,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1236,11 +1127,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1252,8 +1143,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1261,7 +1150,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource] @@ -1286,16 +1174,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1306,14 +1193,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1323,11 +1210,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1338,7 +1225,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_skus_operations.py index e69957be08e..6721b8975e4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/models/_models_py3.py index 61217d1c762..7a69f7c6930 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/models/_models_py3.py @@ -93,22 +93,6 @@ class ProxyResource(Resource): :vartype type: str """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class AppResource(ProxyResource): """App resource payload. @@ -485,7 +469,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar thumbprint: The thumbprint of certificate. :vartype thumbprint: str @@ -724,7 +708,7 @@ def __init__(self, *, network_profile: Optional["_models.NetworkProfile"] = None class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -1165,7 +1149,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -1528,7 +1512,7 @@ def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -1656,7 +1640,7 @@ def __init__(self, *, username: Optional[str] = None, password: Optional[str] = class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -2058,7 +2042,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -2362,7 +2346,7 @@ def __init__(self, *, size_in_gb: Optional[int] = None, mount_path: Optional[str class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeyType @@ -2993,7 +2977,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_apps_operations.py index 71a26786545..d786fe15adf 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -317,7 +317,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -338,23 +337,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -366,20 +364,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -407,7 +401,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -416,16 +410,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -448,10 +441,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -477,14 +466,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -498,7 +479,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -513,18 +494,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -538,7 +511,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -551,19 +524,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -599,7 +561,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -611,17 +573,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -642,22 +602,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -667,11 +626,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -686,14 +641,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -723,7 +670,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -734,24 +681,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -779,7 +722,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -788,16 +731,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -817,10 +759,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -846,14 +784,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -867,7 +797,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -882,18 +812,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -907,7 +829,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -919,20 +841,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -968,7 +879,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -980,17 +891,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1001,7 +910,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource] @@ -1026,17 +934,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1047,14 +954,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1064,11 +971,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1080,10 +987,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1097,7 +1000,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1118,22 +1020,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1145,13 +1046,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore @overload def validate_domain( @@ -1179,7 +1076,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1191,7 +1087,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1206,11 +1102,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1222,7 +1117,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1235,13 +1130,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1271,7 +1162,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1280,16 +1171,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1301,10 +1191,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_bindings_operations.py index 3095eb97cc2..0f8a3e452ab 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -551,17 +513,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -582,23 +542,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,11 +567,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -629,14 +584,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -667,7 +614,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -678,17 +625,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -696,7 +639,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -724,7 +667,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -734,16 +677,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -763,10 +705,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -795,14 +733,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -817,7 +747,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -834,18 +764,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -860,7 +782,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -875,20 +797,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -925,7 +836,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -937,17 +848,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -962,7 +871,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResource] @@ -987,18 +895,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1009,14 +916,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1026,11 +933,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1041,7 +948,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_certificates_operations.py index 07a210a85f8..0de76f95bae 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -495,17 +457,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -526,22 +486,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -551,11 +510,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -570,14 +525,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -607,7 +554,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -618,17 +565,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -641,7 +584,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateResource] @@ -666,17 +608,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -687,14 +628,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -704,11 +645,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -719,7 +660,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_config_servers_operations.py index 12e64b52699..d02dffa3bc6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -476,23 +438,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -520,7 +480,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -528,16 +488,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -557,10 +516,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -584,14 +539,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -604,7 +551,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -617,18 +564,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -641,7 +580,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -652,20 +591,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -700,7 +628,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -712,23 +640,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -756,7 +682,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -764,16 +690,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,10 +718,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -820,14 +741,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -840,7 +753,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -853,18 +766,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -877,7 +782,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -888,20 +793,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -936,7 +830,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -948,14 +842,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_custom_domains_operations.py index a18589b730a..d6461a69186 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -551,17 +513,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -582,23 +542,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,11 +567,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -629,14 +584,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -667,7 +614,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -678,17 +625,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -696,7 +639,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -724,7 +667,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -734,16 +677,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -763,10 +705,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -795,14 +733,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -817,7 +747,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -834,18 +764,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -860,7 +782,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -875,20 +797,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -925,7 +836,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -937,17 +848,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -962,7 +871,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -988,18 +896,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1010,14 +917,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1027,11 +934,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1042,7 +949,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_deployments_operations.py index 3f1708bd29b..959b62b6827 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -462,7 +462,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -483,23 +482,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -511,13 +509,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -525,7 +519,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -553,7 +547,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -563,16 +557,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -595,10 +588,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -628,14 +617,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -650,7 +631,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -667,18 +648,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -693,7 +666,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -708,20 +681,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -758,7 +720,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -770,17 +732,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -801,23 +761,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -827,11 +786,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -848,14 +803,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -886,7 +833,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -897,17 +844,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -915,7 +858,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -943,7 +886,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -953,16 +896,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -982,10 +924,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1015,14 +953,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1037,7 +967,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1054,18 +984,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1080,7 +1002,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1095,20 +1017,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1145,7 +1056,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1157,17 +1068,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1189,7 +1098,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource] @@ -1214,19 +1122,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1237,14 +1144,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1254,11 +1161,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1270,10 +1177,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1287,7 +1190,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource] @@ -1312,18 +1214,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1334,14 +1235,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1351,11 +1252,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1367,10 +1268,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1390,23 +1287,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1416,11 +1312,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1437,14 +1329,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1475,7 +1359,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1486,17 +1370,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1517,23 +1397,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1543,11 +1422,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1564,14 +1439,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1602,7 +1469,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1613,17 +1480,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1644,23 +1507,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1670,11 +1532,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1691,14 +1549,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1729,7 +1579,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1740,17 +1590,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def get_log_file_url( @@ -1767,7 +1613,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1788,23 +1633,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1818,10 +1662,6 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_monitoring_settings_operations.py index 9d557f11dce..fd2e59000e4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -442,23 +404,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -486,7 +446,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -494,16 +454,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -523,10 +482,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -550,14 +505,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +517,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -583,18 +530,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -607,7 +546,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -618,20 +557,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -666,7 +594,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -678,14 +606,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_operations.py index 3622445026b..121c26eddb7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_runtime_versions_operations.py index 5ac2197fa3f..bd59381a780 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_services_operations.py index a62197e36a1..3d2c183e0d5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -406,7 +406,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -427,21 +426,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -453,16 +451,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -489,7 +487,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -497,16 +495,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -529,10 +526,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -555,14 +548,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -575,7 +560,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -588,18 +573,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -609,7 +586,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -619,19 +600,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -666,7 +636,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -678,17 +648,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -709,21 +677,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -733,11 +700,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -748,14 +711,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -784,7 +739,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -795,20 +750,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -835,7 +790,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -843,16 +798,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -872,10 +826,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -898,14 +848,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -918,7 +860,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -931,18 +873,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -952,7 +886,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -961,20 +899,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1009,7 +936,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1021,17 +948,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1042,7 +967,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1063,21 +987,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1089,13 +1012,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1120,7 +1039,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1131,7 +1049,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1144,11 +1062,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1159,7 +1076,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1170,13 +1087,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2021_06_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1206,7 +1119,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1214,16 +1127,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1235,13 +1147,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1254,7 +1162,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1275,21 +1182,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1299,11 +1205,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1314,7 +1216,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1335,21 +1236,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1361,13 +1261,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore @overload def check_name_availability( @@ -1388,7 +1284,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1396,18 +1291,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1415,20 +1314,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2021_06_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2021_06_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1458,23 +1356,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1486,19 +1383,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource] @@ -1523,15 +1415,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1542,14 +1433,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1559,11 +1450,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1575,8 +1466,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1584,7 +1473,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource] @@ -1609,16 +1497,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1629,14 +1516,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1646,11 +1533,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1661,7 +1548,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_skus_operations.py index e35d1c52ffd..29db302af15 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_06_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/_app_platform_management_client.py index 8b71d291d88..843eb6d35c7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -92,7 +94,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -131,7 +151,7 @@ def __init__( ) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize, "2021-09-01-preview") - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -151,7 +171,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/_configuration.py index 344c5249aad..1e7a003a098 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2021-09-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/_app_platform_management_client.py index f443d32b510..b9d0a7f876b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -92,7 +94,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -131,7 +151,9 @@ def __init__( ) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize, "2021-09-01-preview") - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -151,7 +173,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/_configuration.py index 86664d2b98e..86b8d235803 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2021-09-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_apps_operations.py index 102ebce0fae..7976f074fa4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -85,7 +85,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -106,23 +105,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -134,20 +132,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -175,7 +169,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -184,16 +178,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -216,10 +209,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -245,14 +234,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -266,7 +247,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -306,7 +279,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -319,19 +292,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -367,7 +329,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -380,17 +342,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -411,22 +371,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -436,11 +395,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -455,14 +410,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -492,7 +439,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -504,24 +451,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -549,7 +492,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -558,16 +501,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -587,10 +529,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -616,14 +554,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -637,7 +567,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -652,18 +582,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -677,7 +599,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -689,20 +611,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -738,7 +649,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -751,17 +662,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -772,7 +681,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.AppResource] @@ -797,17 +705,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -818,14 +725,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -835,11 +742,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -851,10 +758,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -868,7 +771,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -889,22 +791,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -916,13 +817,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore @overload async def validate_domain( @@ -950,7 +847,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -962,7 +858,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -977,11 +873,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -993,7 +888,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1006,13 +901,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1042,7 +933,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1051,16 +942,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1072,10 +962,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_bindings_operations.py index 75d46b1ad19..46084f396e2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -386,17 +348,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -417,23 +377,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -443,11 +402,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -464,14 +419,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -502,7 +449,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -514,17 +461,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -532,7 +475,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -560,7 +503,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -570,16 +513,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,10 +541,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -631,14 +569,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -653,7 +583,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -670,18 +600,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -696,7 +618,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -711,20 +633,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -761,7 +672,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -774,17 +685,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -799,7 +708,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.BindingResource] @@ -824,18 +732,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -846,14 +753,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -863,11 +770,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -878,7 +785,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_certificates_operations.py index b8c32d65086..1316027b0b2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -371,17 +333,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -402,22 +362,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,11 +386,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -446,14 +401,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -483,7 +430,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -495,17 +442,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -518,7 +461,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.CertificateResource] @@ -543,17 +485,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +505,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -581,11 +522,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +537,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_config_servers_operations.py index 290a2e12fa2..70e3ddac2fc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -348,23 +310,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -392,7 +352,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -400,16 +360,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,10 +388,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -456,14 +411,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -476,7 +423,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -489,18 +436,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -513,7 +452,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -524,20 +463,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -572,7 +500,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,23 +513,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -629,7 +555,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -637,16 +563,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -666,10 +591,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -693,14 +614,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -713,7 +626,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -726,18 +639,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -750,7 +655,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -761,20 +666,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -809,7 +703,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -821,14 +715,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_custom_domains_operations.py index f068b26a258..477c533c6f7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -386,17 +348,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -417,23 +377,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -443,11 +402,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -464,14 +419,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -502,7 +449,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -514,17 +461,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -532,7 +475,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -560,7 +503,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -570,16 +513,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,10 +541,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -631,14 +569,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -653,7 +583,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -670,18 +600,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -696,7 +618,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -711,20 +633,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -761,7 +672,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -774,17 +685,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -799,7 +708,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -825,18 +733,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -847,14 +754,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -864,11 +771,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -879,7 +786,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_deployments_operations.py index 120513d53fc..85ca82f05d2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,13 +133,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -149,7 +143,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -177,7 +171,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -187,16 +181,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -219,10 +212,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -252,14 +241,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -274,7 +255,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -291,18 +272,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -317,7 +290,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -332,20 +305,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -382,7 +344,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -395,17 +357,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -426,23 +386,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -452,11 +411,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -473,14 +428,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -511,7 +458,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -523,17 +470,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -541,7 +484,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -569,7 +512,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -579,16 +522,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,10 +550,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -641,14 +579,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -663,7 +593,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -680,18 +610,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -706,7 +628,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -721,20 +643,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -771,7 +682,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -784,17 +695,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -816,7 +725,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.DeploymentResource] @@ -841,19 +749,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -864,14 +771,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -881,11 +788,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +804,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -914,7 +817,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.DeploymentResource] @@ -939,18 +841,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -961,14 +862,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -978,11 +879,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -994,10 +895,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1017,23 +914,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1043,11 +939,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1064,14 +956,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1102,7 +986,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1114,17 +998,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1145,23 +1025,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1171,11 +1050,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1192,14 +1067,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1230,7 +1097,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1242,17 +1109,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1273,23 +1136,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1299,11 +1161,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1320,14 +1178,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1358,7 +1208,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1370,17 +1220,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1397,7 +1243,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1418,23 +1263,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1448,13 +1292,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1462,7 +1302,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1490,7 +1330,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1500,16 +1340,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1519,11 +1358,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -1554,14 +1389,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1574,7 +1401,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1591,18 +1418,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1615,7 +1434,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -1630,20 +1449,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -1677,7 +1485,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1689,17 +1497,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1707,7 +1511,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1735,7 +1539,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1745,16 +1549,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1764,11 +1567,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -1799,14 +1598,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1819,7 +1610,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1836,18 +1627,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1860,7 +1643,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -1875,20 +1658,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -1922,7 +1694,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1934,17 +1706,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -1952,7 +1720,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1980,7 +1748,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1990,16 +1758,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2009,11 +1776,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/StartJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2044,14 +1807,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2064,7 +1819,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2081,18 +1836,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2105,7 +1852,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2120,20 +1867,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2167,7 +1903,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -2179,14 +1915,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/StartJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_monitoring_settings_operations.py index 50677c5bc1f..421c5068c17 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -349,23 +311,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -393,7 +353,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -401,16 +361,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -430,10 +389,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -457,14 +412,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -477,7 +424,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -490,18 +437,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -514,7 +453,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -525,20 +464,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -573,7 +501,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +514,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_operations.py index 0841ed570fa..2e0cc545622 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_runtime_versions_operations.py index 01a9cb7d794..cb140adfc59 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_services_operations.py index 0e133d0b459..5220efd0375 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -101,21 +100,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,16 +125,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -163,7 +161,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -171,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -229,14 +222,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -249,7 +234,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -262,18 +247,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -283,7 +260,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -293,19 +274,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -340,7 +310,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -353,17 +323,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -384,21 +352,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -408,11 +375,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -423,14 +386,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -459,7 +414,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -471,20 +426,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -511,7 +466,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -519,16 +474,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,10 +502,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -574,14 +524,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -594,7 +536,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -607,18 +549,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -628,7 +562,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -637,20 +575,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -685,7 +612,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -698,17 +625,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -719,7 +644,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -740,21 +664,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -766,13 +689,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -797,7 +716,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -808,7 +726,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -821,11 +739,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -836,7 +753,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -847,13 +764,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2021_09_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -883,7 +796,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -891,16 +804,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -912,13 +824,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -931,7 +839,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -952,21 +859,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -976,11 +882,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -993,7 +895,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1014,21 +915,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1040,13 +940,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1067,35 +963,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1106,14 +997,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1142,7 +1025,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1154,17 +1037,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1185,35 +1064,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1224,14 +1098,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1260,7 +1126,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1272,17 +1138,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -1303,7 +1165,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1311,18 +1172,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1330,20 +1195,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2021_09_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1373,23 +1237,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1401,19 +1264,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.ServiceResource] @@ -1438,15 +1296,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1457,14 +1314,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1474,11 +1331,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1490,8 +1347,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1499,7 +1354,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.ServiceResource] @@ -1524,16 +1378,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1544,14 +1397,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1561,11 +1414,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,7 +1429,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_skus_operations.py index e671d73cf2d..b77ba7c2b4e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_storages_operations.py index 8ed6a5685ae..4947c5fcff0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -270,18 +251,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -295,7 +268,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -308,20 +281,9 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -357,7 +319,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -370,17 +332,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -401,22 +361,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,11 +385,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -445,14 +400,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -482,7 +429,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -494,17 +441,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -517,7 +460,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.StorageResource] @@ -542,17 +484,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -563,14 +504,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -580,11 +521,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -595,7 +536,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/models/_models_py3.py index bb7c8387669..3515ffc64ec 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/models/_models_py3.py @@ -94,22 +94,6 @@ class ProxyResource(Resource): :vartype type: str """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class AppResource(ProxyResource): """App resource payload. @@ -366,7 +350,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -419,7 +403,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -619,7 +603,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -853,7 +837,7 @@ def __init__(self, *, network_profile: Optional["_models.NetworkProfile"] = None class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -1129,7 +1113,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -1354,7 +1338,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -1406,7 +1390,7 @@ def __init__(self, *, is_valid: Optional[bool] = None, message: Optional[str] = class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -1833,7 +1817,7 @@ def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -1963,7 +1947,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -2051,7 +2035,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -2085,7 +2069,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -2487,7 +2471,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -2791,7 +2775,7 @@ def __init__(self, *, size_in_gb: Optional[int] = None, mount_path: Optional[str class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2021_09_01_preview.models.TestKeyType @@ -3422,7 +3406,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -3479,7 +3463,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2021_09_01_preview.models.StorageType @@ -3504,7 +3488,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2021_09_01_preview.models.StorageType diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_apps_operations.py index a5a1a435834..d640c7f52b0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -317,7 +317,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -338,23 +337,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -366,20 +364,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -407,7 +401,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -416,16 +410,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -448,10 +441,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -477,14 +466,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -498,7 +479,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -513,18 +494,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -538,7 +511,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -551,19 +524,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -599,7 +561,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -611,17 +573,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -642,22 +602,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -667,11 +626,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -686,14 +641,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -723,7 +670,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -734,24 +681,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -779,7 +722,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -788,16 +731,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -817,10 +759,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -846,14 +784,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -867,7 +797,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -882,18 +812,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -907,7 +829,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -919,20 +841,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -968,7 +879,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -980,17 +891,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1001,7 +910,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.AppResource] @@ -1026,17 +934,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1047,14 +954,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1064,11 +971,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1080,10 +987,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1097,7 +1000,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1118,22 +1020,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1145,13 +1046,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore @overload def validate_domain( @@ -1179,7 +1076,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1191,7 +1087,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1206,11 +1102,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1222,7 +1117,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1235,13 +1130,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1271,7 +1162,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1280,16 +1171,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1301,10 +1191,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_bindings_operations.py index 6f695c50f11..948a9898cae 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -551,17 +513,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -582,23 +542,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,11 +567,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -629,14 +584,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -667,7 +614,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -678,17 +625,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -696,7 +639,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -724,7 +667,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -734,16 +677,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -763,10 +705,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -795,14 +733,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -817,7 +747,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -834,18 +764,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -860,7 +782,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -875,20 +797,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -925,7 +836,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -937,17 +848,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -962,7 +871,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.BindingResource] @@ -987,18 +895,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1009,14 +916,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1026,11 +933,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1041,7 +948,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_certificates_operations.py index 1bb0a075f63..ed9bb4face7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -495,17 +457,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -526,22 +486,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -551,11 +510,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -570,14 +525,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -607,7 +554,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -618,17 +565,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -641,7 +584,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.CertificateResource] @@ -666,17 +608,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -687,14 +628,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -704,11 +645,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -719,7 +660,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_config_servers_operations.py index ba0ec8e37d4..781e8209505 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -476,23 +438,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -520,7 +480,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -528,16 +488,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -557,10 +516,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -584,14 +539,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -604,7 +551,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -617,18 +564,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -641,7 +580,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -652,20 +591,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -700,7 +628,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -712,23 +640,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -756,7 +682,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -764,16 +690,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,10 +718,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -820,14 +741,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -840,7 +753,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -853,18 +766,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -877,7 +782,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -888,20 +793,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -936,7 +830,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -948,14 +842,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_custom_domains_operations.py index a11b665a6de..636880cfe98 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -551,17 +513,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -582,23 +542,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,11 +567,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -629,14 +584,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -667,7 +614,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -678,17 +625,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -696,7 +639,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -724,7 +667,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -734,16 +677,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -763,10 +705,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -795,14 +733,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -817,7 +747,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -834,18 +764,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -860,7 +782,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -875,20 +797,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -925,7 +836,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -937,17 +848,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -962,7 +871,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -988,18 +896,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1010,14 +917,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1027,11 +934,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1042,7 +949,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_deployments_operations.py index fde5696df56..e388116bf47 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -585,7 +585,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -606,23 +605,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -634,13 +632,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -648,7 +642,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -676,7 +670,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -686,16 +680,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -718,10 +711,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -751,14 +740,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -773,7 +754,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -790,18 +771,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -816,7 +789,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -831,20 +804,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -881,7 +843,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -893,17 +855,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -924,23 +884,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -950,11 +909,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -971,14 +926,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1009,7 +956,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1020,17 +967,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1038,7 +981,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1066,7 +1009,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1076,16 +1019,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1105,10 +1047,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1138,14 +1076,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1160,7 +1090,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1177,18 +1107,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1203,7 +1125,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1218,20 +1140,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1268,7 +1179,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1280,17 +1191,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1312,7 +1221,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.DeploymentResource] @@ -1337,19 +1245,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1360,14 +1267,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1377,11 +1284,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1393,10 +1300,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1410,7 +1313,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.DeploymentResource] @@ -1435,18 +1337,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1457,14 +1358,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1474,11 +1375,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1490,10 +1391,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1513,23 +1410,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1539,11 +1435,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1560,14 +1452,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1598,7 +1482,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1609,17 +1493,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1640,23 +1520,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1666,11 +1545,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1687,14 +1562,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1725,7 +1592,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1736,17 +1603,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1767,23 +1630,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1793,11 +1655,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1814,14 +1672,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1852,7 +1702,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1863,17 +1713,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def get_log_file_url( @@ -1890,7 +1736,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1911,23 +1756,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1941,13 +1785,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1955,7 +1795,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1983,7 +1823,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1993,16 +1833,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2012,11 +1851,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2047,14 +1882,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2067,7 +1894,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2084,18 +1911,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2108,7 +1927,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2123,20 +1942,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2170,7 +1978,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2181,17 +1989,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2199,7 +2003,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2227,7 +2031,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2237,16 +2041,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2256,11 +2059,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2291,14 +2090,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2311,7 +2102,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2328,18 +2119,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2352,7 +2135,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2367,20 +2150,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2414,7 +2186,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2425,17 +2197,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2443,7 +2211,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2471,7 +2239,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2481,16 +2249,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2500,11 +2267,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/StartJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -2535,14 +2298,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2555,7 +2310,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2572,18 +2327,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2596,7 +2343,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -2611,20 +2358,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2658,7 +2394,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2669,14 +2405,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/StartJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_monitoring_settings_operations.py index 2a0092724b7..7b4257cd0eb 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -442,23 +404,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -486,7 +446,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -494,16 +454,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -523,10 +482,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -550,14 +505,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +517,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -583,18 +530,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -607,7 +546,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -618,20 +557,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2021_09_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -666,7 +594,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -678,14 +606,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_operations.py index 35a846c3da5..25f92e89183 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_runtime_versions_operations.py index ee9ebc106b4..39a36bf7126 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_services_operations.py index ebf79cab5bc..22bb55d93e9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -466,7 +466,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -487,21 +486,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -513,16 +511,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -549,7 +547,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -557,16 +555,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,10 +586,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -615,14 +608,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -635,7 +620,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -648,18 +633,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -669,7 +646,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -679,19 +660,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -726,7 +696,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -738,17 +708,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -769,21 +737,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,11 +760,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -808,14 +771,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -844,7 +799,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -855,20 +810,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -895,7 +850,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -903,16 +858,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -932,10 +886,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -958,14 +908,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -978,7 +920,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -991,18 +933,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1012,7 +946,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1021,20 +959,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1069,7 +996,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1081,17 +1008,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1102,7 +1027,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1123,21 +1047,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1149,13 +1072,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1180,7 +1099,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1191,7 +1109,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1204,11 +1122,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1219,7 +1136,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1230,13 +1147,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2021_09_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1266,7 +1179,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1274,16 +1187,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1295,13 +1207,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1314,7 +1222,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1335,21 +1242,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1359,11 +1265,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1374,7 +1276,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1395,21 +1296,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1421,13 +1321,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1448,35 +1344,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1487,14 +1378,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1523,7 +1406,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1534,17 +1417,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1565,35 +1444,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1604,14 +1478,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1640,7 +1506,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1651,17 +1517,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -1682,7 +1544,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1690,18 +1551,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1709,20 +1574,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2021_09_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2021_09_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1752,23 +1616,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1780,19 +1643,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.ServiceResource] @@ -1817,15 +1675,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1836,14 +1693,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1853,11 +1710,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1869,8 +1726,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1878,7 +1733,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.ServiceResource] @@ -1903,16 +1757,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1923,14 +1776,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1940,11 +1793,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1955,7 +1808,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_skus_operations.py index 4aecc29ba33..91ace29d536 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_storages_operations.py index a8f5b1666c3..854876982e8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2021_09_01_preview/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2021_09_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -359,14 +348,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -380,7 +361,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -395,18 +376,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -420,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -433,20 +406,9 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2021_09_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -482,7 +444,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -494,17 +456,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -525,22 +485,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -550,11 +509,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -569,14 +524,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -606,7 +553,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -617,17 +564,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -638,7 +581,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2021_09_01_preview.models.StorageResource] @@ -663,17 +605,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -684,14 +625,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -701,11 +642,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -716,7 +657,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/_app_platform_management_client.py index 0a040bc3ec6..38b0b281809 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -135,7 +137,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -207,7 +227,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2022-01-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -227,7 +247,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/_configuration.py index c961a9a2c27..3b45462ce14 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2022-01-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/_app_platform_management_client.py index 05432e1afae..5584e7cfc82 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -135,7 +137,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -207,7 +227,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2022-01-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -227,7 +249,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/_configuration.py index 1fbb5e9d7da..2266a0249b6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2022-01-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_api_portal_custom_domains_operations.py index d115890704b..7b4a8c2dcb5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -385,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -416,23 +376,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +401,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +418,6 @@ async def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -501,7 +448,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -513,17 +460,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -538,7 +481,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -564,18 +506,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -586,14 +527,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -603,11 +544,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -618,7 +559,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_api_portals_operations.py index 71acdb26a88..147fbc7b4a7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,17 +330,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -399,22 +359,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,11 +383,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -443,14 +398,6 @@ async def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -492,17 +439,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -515,7 +458,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.ApiPortalResource] @@ -540,17 +482,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -561,14 +502,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -578,11 +519,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -594,10 +535,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload async def validate_domain( self, @@ -624,7 +561,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -636,7 +572,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -651,11 +587,10 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -667,7 +602,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -680,13 +615,9 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -716,7 +647,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -725,16 +656,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,10 +676,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_apps_operations.py index 4b7301c3654..82bc23b95b0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,20 +133,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -176,7 +170,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -185,16 +179,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -217,10 +210,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -246,14 +235,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -267,7 +248,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -320,19 +293,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -368,7 +330,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -381,17 +343,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -412,22 +372,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +396,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -456,14 +411,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -493,7 +440,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -505,24 +452,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -550,7 +493,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -559,16 +502,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +530,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -617,14 +555,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -638,7 +568,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -653,18 +583,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -678,7 +600,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -690,20 +612,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -739,7 +650,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -752,17 +663,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -773,7 +682,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.AppResource] @@ -798,17 +706,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -819,14 +726,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -836,11 +743,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -852,10 +759,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -869,7 +772,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -890,22 +792,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -917,20 +818,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -958,7 +855,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -967,16 +864,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -996,10 +892,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -1026,14 +918,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1047,7 +931,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1062,18 +946,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1087,7 +963,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1100,20 +976,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1149,7 +1014,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1162,17 +1027,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1200,7 +1063,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1212,7 +1074,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1227,11 +1089,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1243,7 +1104,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1256,13 +1117,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1292,7 +1149,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1301,16 +1158,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1322,10 +1178,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_bindings_operations.py index f3f63b754c5..a8eb3e3e4a6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -386,17 +348,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -417,23 +377,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -443,11 +402,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -464,14 +419,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -502,7 +449,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -514,17 +461,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -532,7 +475,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -560,7 +503,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -570,16 +513,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,10 +541,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -631,14 +569,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -653,7 +583,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -670,18 +600,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -696,7 +618,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -711,20 +633,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -761,7 +672,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -774,17 +685,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -799,7 +708,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.BindingResource] @@ -824,18 +732,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -846,14 +753,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -863,11 +770,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -878,7 +785,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_build_service_agent_pool_operations.py index 30d51c9b746..af1bad6faab 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -174,7 +168,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -195,23 +188,22 @@ async def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -223,13 +215,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -237,7 +225,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -265,7 +253,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -275,16 +263,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -304,10 +291,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -337,14 +320,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -359,7 +334,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +351,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -402,7 +369,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -417,20 +384,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -467,7 +423,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -480,14 +436,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_build_service_builder_operations.py index 6bff778ef22..d79a7849498 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -239,14 +228,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -261,7 +242,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -278,18 +259,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -304,7 +277,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -319,20 +292,9 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -369,7 +331,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -510,17 +457,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -535,7 +478,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.BuilderResource] @@ -560,18 +502,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -582,14 +523,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -599,11 +540,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -614,7 +555,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_build_service_operations.py index f0e395483ac..76f186b699d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildService] @@ -105,17 +104,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -126,14 +124,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -143,11 +141,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -159,10 +157,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -176,7 +170,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -197,22 +190,21 @@ async def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -224,13 +216,9 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -245,7 +233,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.Build] @@ -270,18 +257,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -292,14 +278,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -309,11 +295,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -325,10 +311,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -344,7 +326,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -365,23 +346,22 @@ async def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -393,13 +373,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -429,7 +405,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -442,7 +417,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -459,11 +434,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -476,7 +450,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -490,13 +464,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2022_01_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2022_01_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -526,7 +496,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -536,16 +506,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -565,10 +534,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -584,7 +549,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildResult] @@ -609,19 +573,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -632,14 +595,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -649,11 +612,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -665,10 +628,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -692,7 +651,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -713,7 +671,7 @@ async def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -721,16 +679,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -742,13 +699,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -773,7 +726,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -794,7 +746,7 @@ async def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -802,16 +754,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -823,13 +774,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -844,7 +791,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -865,22 +811,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -892,13 +837,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -913,7 +854,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -934,22 +874,21 @@ async def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -961,13 +900,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -984,7 +919,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1005,23 +939,22 @@ async def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1033,13 +966,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1054,7 +983,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1075,22 +1003,21 @@ async def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1102,13 +1029,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1125,7 +1048,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1146,23 +1068,22 @@ async def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,10 +1095,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_buildpack_binding_operations.py index b989d042007..f3f0b0aae61 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -85,7 +85,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -106,7 +105,7 @@ async def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -114,16 +113,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,13 +133,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -150,7 +144,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -178,7 +172,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -189,16 +183,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,10 +211,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -255,14 +244,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -278,7 +259,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -298,18 +279,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -325,7 +298,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -342,20 +315,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -393,7 +355,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -406,17 +368,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -443,7 +403,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -451,16 +411,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -470,11 +429,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -499,14 +454,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -538,7 +485,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -550,17 +497,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -577,7 +520,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -603,19 +545,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -626,14 +567,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -643,11 +584,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -658,7 +599,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_certificates_operations.py index b0bb1c724d9..4ad34b1a61a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -371,17 +333,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -402,22 +362,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,11 +386,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -446,14 +401,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -483,7 +430,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -495,17 +442,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -518,7 +461,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.CertificateResource] @@ -543,17 +485,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +505,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -581,11 +522,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +537,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_config_servers_operations.py index 61779f08494..0aa6dd8d3fe 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -348,23 +310,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -392,7 +352,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -400,16 +360,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,10 +388,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -456,14 +411,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -476,7 +423,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -489,18 +436,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -513,7 +452,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -524,20 +463,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -572,7 +500,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,23 +513,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -629,7 +555,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -637,16 +563,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -666,10 +591,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -693,14 +614,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -713,7 +626,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -726,18 +639,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -750,7 +655,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -761,20 +666,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -809,7 +703,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -821,14 +715,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_configuration_services_operations.py index 821bef59fe2..c0c4dfe1629 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -310,20 +283,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -359,7 +321,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -372,17 +334,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -403,22 +363,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,11 +387,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -447,14 +402,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -484,7 +431,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -496,17 +443,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -519,7 +462,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -545,17 +487,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -566,14 +507,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -583,11 +524,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,16 +540,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -636,7 +573,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -645,16 +582,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -674,10 +610,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -703,14 +635,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -724,7 +648,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -739,18 +663,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -764,7 +680,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -777,20 +693,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -826,7 +731,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -838,14 +743,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_custom_domains_operations.py index 06fe4f15ac5..37bb88d3f07 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -386,17 +348,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -417,23 +377,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -443,11 +402,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -464,14 +419,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -502,7 +449,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -514,17 +461,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -532,7 +475,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -560,7 +503,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -570,16 +513,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,10 +541,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -631,14 +569,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -653,7 +583,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -670,18 +600,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -696,7 +618,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -711,20 +633,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -761,7 +672,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -774,17 +685,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -799,7 +708,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -825,18 +733,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -847,14 +754,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -864,11 +771,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -879,7 +786,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_deployments_operations.py index 45b05b4c171..4b625987f82 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,13 +133,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -149,7 +143,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -177,7 +171,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -187,16 +181,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -219,10 +212,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -252,14 +241,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -274,7 +255,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -291,18 +272,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -317,7 +290,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -332,20 +305,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -382,7 +344,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -395,17 +357,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -426,23 +386,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -452,11 +411,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -473,14 +428,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -511,7 +458,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -523,17 +470,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -541,7 +484,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -569,7 +512,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -579,16 +522,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,10 +550,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -641,14 +579,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -663,7 +593,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -680,18 +610,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -706,7 +628,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -721,20 +643,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -771,7 +682,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -784,17 +695,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -816,7 +725,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.DeploymentResource] @@ -841,19 +749,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -864,14 +771,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -881,11 +788,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +804,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -914,7 +817,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.DeploymentResource] @@ -939,18 +841,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -961,14 +862,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -978,11 +879,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -994,10 +895,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1017,23 +914,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1043,11 +939,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1064,14 +956,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1102,7 +986,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1114,17 +998,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1145,23 +1025,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1171,11 +1050,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1192,14 +1067,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1230,7 +1097,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1242,17 +1109,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1273,23 +1136,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1299,11 +1161,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1320,14 +1178,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1358,7 +1208,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1370,17 +1220,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1397,7 +1243,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1418,23 +1263,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1448,13 +1292,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1462,7 +1302,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1490,7 +1330,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1500,16 +1340,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1519,11 +1358,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -1554,14 +1389,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1574,7 +1401,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1591,18 +1418,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1615,7 +1434,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -1630,20 +1449,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -1677,7 +1485,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1689,17 +1497,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1707,7 +1511,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1735,7 +1539,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1745,16 +1549,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1764,11 +1567,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -1799,14 +1598,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1819,7 +1610,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1836,18 +1627,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1860,7 +1643,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -1875,20 +1658,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -1922,7 +1694,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1934,17 +1706,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -1952,7 +1720,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1980,7 +1748,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1990,16 +1758,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2009,11 +1776,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2044,14 +1807,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2064,7 +1819,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2081,18 +1836,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2105,7 +1852,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2120,20 +1867,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2167,7 +1903,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -2179,14 +1915,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_gateway_custom_domains_operations.py index a0c417aed76..7896c45ca9b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -385,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -416,23 +376,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +401,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +418,6 @@ async def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -501,7 +448,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -513,17 +460,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -538,7 +481,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -564,18 +506,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -586,14 +527,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -603,11 +544,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -618,7 +559,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_gateway_route_configs_operations.py index 34ab42fa0fa..9d5790c7fa0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -264,7 +245,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -283,18 +264,10 @@ async def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -309,7 +282,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -325,20 +298,9 @@ async def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -375,7 +337,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -388,17 +350,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -419,23 +379,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -445,11 +404,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -466,14 +421,6 @@ async def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -504,7 +451,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -516,17 +463,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -541,7 +484,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -567,18 +509,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -589,14 +530,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -606,11 +547,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -621,7 +562,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_gateways_operations.py index a9776460dec..51a9d880d66 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,17 +330,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -399,22 +359,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,11 +383,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -443,14 +398,6 @@ async def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -492,17 +439,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -515,7 +458,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayResource] @@ -540,17 +482,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -561,14 +502,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -578,11 +519,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -594,10 +535,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload async def validate_domain( self, @@ -624,7 +561,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -636,7 +572,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -651,11 +587,10 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -667,7 +602,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -680,13 +615,9 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -716,7 +647,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -725,16 +656,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,10 +676,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_monitoring_settings_operations.py index 43f0bde9ba6..b21ffaac25c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -349,23 +311,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -393,7 +353,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -401,16 +361,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -430,10 +389,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -457,14 +412,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -477,7 +424,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -490,18 +437,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -514,7 +453,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -525,20 +464,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -573,7 +501,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +514,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_operations.py index 6868ee4107b..229af54776b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_runtime_versions_operations.py index 16f0ad2e0fb..f54f48548f1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_service_registries_operations.py index 1acbfef2051..92ad65e8d92 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,13 +120,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -149,22 +143,21 @@ async def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -184,10 +177,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -201,14 +190,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -241,7 +222,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -254,17 +235,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -285,22 +264,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -310,11 +288,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -329,14 +303,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -366,7 +332,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -378,17 +344,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -401,7 +363,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -427,17 +388,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -448,14 +408,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -465,11 +425,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -480,7 +440,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_services_operations.py index cf8a5f811d4..cac3a313180 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -101,21 +100,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,16 +125,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -163,7 +161,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -171,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -229,14 +222,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -249,7 +234,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -262,18 +247,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -283,7 +260,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -293,19 +274,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -340,7 +310,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -353,17 +323,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -384,21 +352,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -408,11 +375,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -423,14 +386,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -459,7 +414,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -471,20 +426,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -511,7 +466,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -519,16 +474,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,10 +502,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -574,14 +524,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -594,7 +536,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -607,18 +549,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -628,7 +562,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -637,20 +575,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -685,7 +612,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -698,17 +625,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -719,7 +644,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -740,21 +664,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -766,13 +689,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -797,7 +716,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -808,7 +726,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -821,11 +739,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -836,7 +753,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -847,13 +764,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_01_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -883,7 +796,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -891,16 +804,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -912,13 +824,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -931,7 +839,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -952,21 +859,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -976,11 +882,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -993,7 +895,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1014,21 +915,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1040,13 +940,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1067,35 +963,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1106,14 +997,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1142,7 +1025,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1154,17 +1037,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1185,35 +1064,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1224,14 +1098,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1260,7 +1126,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1272,17 +1138,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -1303,7 +1165,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1311,18 +1172,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1330,20 +1195,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_01_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1373,23 +1237,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1401,19 +1264,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceResource] @@ -1438,15 +1296,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1457,14 +1314,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1474,11 +1331,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1490,8 +1347,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1499,7 +1354,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceResource] @@ -1524,16 +1378,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1544,14 +1397,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1561,11 +1414,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,7 +1429,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_skus_operations.py index a00d6981d25..a3f4e399e15 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_storages_operations.py index 0f30e74d034..5a2454944f4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -270,18 +251,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -295,7 +268,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -308,20 +281,9 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -357,7 +319,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -370,17 +332,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -401,22 +361,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,11 +385,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -445,14 +400,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -482,7 +429,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -494,17 +441,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -517,7 +460,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.StorageResource] @@ -542,17 +484,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -563,14 +504,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -580,11 +521,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -595,7 +536,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/models/_models_py3.py index 795d37bf5ba..9e183ae399a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/models/_models_py3.py @@ -118,24 +118,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2022_01_01_preview.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class ApiPortalCustomDomainResource(ProxyResource): """Custom domain of the API portal. @@ -720,7 +702,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -773,7 +755,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -1572,7 +1554,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -1610,7 +1592,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -1979,7 +1961,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -2230,7 +2212,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -2529,7 +2511,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -2566,7 +2548,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -2878,7 +2860,7 @@ def __init__( self.git_property = git_property -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -2933,7 +2915,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3052,7 +3034,7 @@ def __init__( class CustomContainerUserSourceInfo(UserSourceInfo): """Custom container user source info. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -3203,7 +3185,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -3255,7 +3237,7 @@ def __init__(self, *, is_valid: Optional[bool] = None, message: Optional[str] = class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -4364,7 +4346,7 @@ def __init__( class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -4495,7 +4477,7 @@ class UploadedUserSourceInfo(UserSourceInfo): You probably want to use the sub-classes and not this class directly. Known sub-classes are: JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4538,7 +4520,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4594,7 +4576,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -4682,7 +4664,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -4716,7 +4698,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -5122,7 +5104,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -5155,7 +5137,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -5480,7 +5462,7 @@ def __init__(self, *, size_in_gb: Optional[int] = None, mount_path: Optional[str class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2022_01_01_preview.models.TestKeyType @@ -6296,7 +6278,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -6350,7 +6332,7 @@ def __init__( class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -6491,7 +6473,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2022_01_01_preview.models.StorageType @@ -6516,7 +6498,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2022_01_01_preview.models.StorageType diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_api_portal_custom_domains_operations.py index d484d3d6bb8..b229abe6d64 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -530,17 +492,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -561,23 +521,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -587,11 +546,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -608,14 +563,6 @@ def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -646,7 +593,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -657,17 +604,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -682,7 +625,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -708,18 +650,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -730,14 +671,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -747,11 +688,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -762,7 +703,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_api_portals_operations.py index 7c5caad65c2..4fc5700a866 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -465,20 +438,9 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -526,17 +488,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -557,22 +517,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,11 +541,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -601,14 +556,6 @@ def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -638,7 +585,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -649,17 +596,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: @@ -670,7 +613,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.ApiPortalResource] @@ -695,17 +637,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -716,14 +657,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -733,11 +674,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -749,10 +690,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload def validate_domain( self, @@ -779,7 +716,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -791,7 +727,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -806,11 +742,10 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -822,7 +757,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -835,13 +770,9 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -871,7 +802,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -880,16 +811,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -901,10 +831,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_apps_operations.py index 2cf76221acd..fe0fa405bff 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -373,23 +372,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -401,20 +399,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -442,7 +436,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -451,16 +445,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -483,10 +476,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -512,14 +501,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -533,7 +514,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -548,18 +529,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -573,7 +546,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -586,19 +559,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -634,7 +596,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -646,17 +608,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -677,22 +637,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -702,11 +661,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -721,14 +676,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -758,7 +705,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -769,24 +716,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -814,7 +757,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -823,16 +766,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -852,10 +794,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -881,14 +819,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -902,7 +832,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -917,18 +847,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -942,7 +864,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -954,20 +876,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1003,7 +914,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1015,17 +926,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1036,7 +945,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.AppResource] @@ -1061,17 +969,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1082,14 +989,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1099,11 +1006,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1115,10 +1022,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1132,7 +1035,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1153,22 +1055,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1180,20 +1081,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1221,7 +1118,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1230,16 +1127,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1259,10 +1155,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1289,14 +1181,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1310,7 +1194,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1325,18 +1209,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1350,7 +1226,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1363,20 +1239,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1412,7 +1277,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1424,17 +1289,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1462,7 +1325,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1474,7 +1336,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1489,11 +1351,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1505,7 +1366,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1518,13 +1379,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1554,7 +1411,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1563,16 +1420,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1584,10 +1440,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_bindings_operations.py index cdba98679e4..b46527a66e2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -551,17 +513,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -582,23 +542,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,11 +567,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -629,14 +584,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -667,7 +614,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -678,17 +625,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -696,7 +639,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -724,7 +667,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -734,16 +677,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -763,10 +705,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -795,14 +733,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -817,7 +747,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -834,18 +764,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -860,7 +782,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -875,20 +797,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -925,7 +836,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -937,17 +848,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -962,7 +871,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.BindingResource] @@ -987,18 +895,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1009,14 +916,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1026,11 +933,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1041,7 +948,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_build_service_agent_pool_operations.py index 107c886142e..0f3e8f6834b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -209,18 +208,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -231,14 +229,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -248,11 +246,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -264,10 +262,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -283,7 +277,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -304,23 +297,22 @@ def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -332,13 +324,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -346,7 +334,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -374,7 +362,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -384,16 +372,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -413,10 +400,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -446,14 +429,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -468,7 +443,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -485,18 +460,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -511,7 +478,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -526,20 +493,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -576,7 +532,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -588,14 +544,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_build_service_builder_operations.py index fb17ac59e43..f509d6d639a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -385,14 +374,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -407,7 +388,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -424,18 +405,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -450,7 +423,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -465,20 +438,9 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -515,7 +477,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -527,17 +489,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -558,23 +518,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,11 +543,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -605,14 +560,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -643,7 +590,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -654,17 +601,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -679,7 +622,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.BuilderResource] @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_build_service_operations.py index 64f4e8e6092..7f5c982323f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -532,7 +532,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildService] @@ -557,17 +556,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -578,14 +576,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -595,11 +593,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -611,10 +609,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -628,7 +622,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -649,22 +642,21 @@ def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -676,13 +668,9 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -697,7 +685,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -721,18 +708,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -743,14 +729,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -760,11 +746,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -776,10 +762,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -795,7 +777,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -816,23 +797,22 @@ def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -844,13 +824,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -880,7 +856,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -893,7 +868,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -910,11 +885,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -927,7 +901,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -941,13 +915,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2022_01_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2022_01_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -977,7 +947,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -987,16 +957,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1016,10 +985,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1035,7 +1000,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildResult] @@ -1060,19 +1024,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1083,14 +1046,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1100,11 +1063,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1116,10 +1079,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1143,7 +1102,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1164,7 +1122,7 @@ def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1172,16 +1130,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1193,13 +1150,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1224,7 +1177,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1245,7 +1197,7 @@ def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1253,16 +1205,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1274,13 +1225,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1295,7 +1242,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1316,22 +1262,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1343,13 +1288,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1364,7 +1305,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1385,22 +1325,21 @@ def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1412,13 +1351,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1435,7 +1370,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1456,23 +1390,22 @@ def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1484,13 +1417,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1505,7 +1434,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1526,22 +1454,21 @@ def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1553,13 +1480,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -1576,7 +1499,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1597,23 +1519,22 @@ def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1625,10 +1546,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_buildpack_binding_operations.py index 2d7472cb6c0..5d53b260f6d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -243,7 +243,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -264,7 +263,7 @@ def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -272,16 +271,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -308,7 +302,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -336,7 +330,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -347,16 +341,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -376,10 +369,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -413,14 +402,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -436,7 +417,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -456,18 +437,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -483,7 +456,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -500,20 +473,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -551,7 +513,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -563,17 +525,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -600,7 +560,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -608,16 +568,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -627,11 +586,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -656,14 +611,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -695,7 +642,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -706,17 +653,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -733,7 +676,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -759,19 +701,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -782,14 +723,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -799,11 +740,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -814,7 +755,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_certificates_operations.py index 204827b4bdf..8042a6500ab 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -495,17 +457,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -526,22 +486,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -551,11 +510,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -570,14 +525,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -607,7 +554,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -618,17 +565,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -641,7 +584,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.CertificateResource] @@ -666,17 +608,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -687,14 +628,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -704,11 +645,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -719,7 +660,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_config_servers_operations.py index 6d90ac2aa7a..088fd96261b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -476,23 +438,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -520,7 +480,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -528,16 +488,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -557,10 +516,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -584,14 +539,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -604,7 +551,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -617,18 +564,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -641,7 +580,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -652,20 +591,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -700,7 +628,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -712,23 +640,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -756,7 +682,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -764,16 +690,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,10 +718,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -820,14 +741,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -840,7 +753,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -853,18 +766,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -877,7 +782,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -888,20 +793,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -936,7 +830,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -948,14 +842,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_configuration_services_operations.py index 270e21cc3f6..8c83aa6f19a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -393,14 +382,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -414,7 +395,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -430,18 +411,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -469,20 +442,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -530,17 +492,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -561,22 +521,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -586,11 +545,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -605,14 +560,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -642,7 +589,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -676,7 +619,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -702,17 +644,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -723,14 +664,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -740,11 +681,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -756,16 +697,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -793,7 +730,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -802,16 +739,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -831,10 +767,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -860,14 +792,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -881,7 +805,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -896,18 +820,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -921,7 +837,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -934,20 +850,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -983,7 +888,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -995,14 +900,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_custom_domains_operations.py index 29e33fd23af..a9ca6b17a00 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -551,17 +513,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -582,23 +542,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,11 +567,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -629,14 +584,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -667,7 +614,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -678,17 +625,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -696,7 +639,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -724,7 +667,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -734,16 +677,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -763,10 +705,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -795,14 +733,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -817,7 +747,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -834,18 +764,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -860,7 +782,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -875,20 +797,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -925,7 +836,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -937,17 +848,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -962,7 +871,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -988,18 +896,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1010,14 +917,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1027,11 +934,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1042,7 +949,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_deployments_operations.py index e147d683066..d29d4461c02 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -585,7 +585,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -606,23 +605,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -634,13 +632,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -648,7 +642,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -676,7 +670,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -686,16 +680,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -718,10 +711,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -751,14 +740,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -773,7 +754,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -790,18 +771,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -816,7 +789,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -831,20 +804,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -881,7 +843,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -893,17 +855,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -924,23 +884,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -950,11 +909,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -971,14 +926,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1009,7 +956,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1020,17 +967,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1038,7 +981,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1066,7 +1009,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1076,16 +1019,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1105,10 +1047,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1138,14 +1076,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1160,7 +1090,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1177,18 +1107,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1203,7 +1125,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1218,20 +1140,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1268,7 +1179,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1280,17 +1191,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1312,7 +1221,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.DeploymentResource] @@ -1337,19 +1245,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1360,14 +1267,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1377,11 +1284,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1393,10 +1300,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1410,7 +1313,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.DeploymentResource] @@ -1435,18 +1337,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1457,14 +1358,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1474,11 +1375,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1490,10 +1391,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1513,23 +1410,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1539,11 +1435,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1560,14 +1452,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1598,7 +1482,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1609,17 +1493,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1640,23 +1520,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1666,11 +1545,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1687,14 +1562,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1725,7 +1592,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1736,17 +1603,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1767,23 +1630,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1793,11 +1655,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1814,14 +1672,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1852,7 +1702,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1863,17 +1713,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def get_log_file_url( @@ -1890,7 +1736,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1911,23 +1756,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1941,13 +1785,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1955,7 +1795,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1983,7 +1823,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1993,16 +1833,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2012,11 +1851,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2047,14 +1882,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2067,7 +1894,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2084,18 +1911,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2108,7 +1927,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2123,20 +1942,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2170,7 +1978,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2181,17 +1989,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2199,7 +2003,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2227,7 +2031,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2237,16 +2041,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2256,11 +2059,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2291,14 +2090,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2311,7 +2102,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2328,18 +2119,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2352,7 +2135,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2367,20 +2150,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2414,7 +2186,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2425,17 +2197,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2443,7 +2211,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2471,7 +2239,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2481,16 +2249,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2500,11 +2267,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -2535,14 +2298,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2555,7 +2310,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2572,18 +2327,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2596,7 +2343,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -2611,20 +2358,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2658,7 +2394,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2669,14 +2405,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_gateway_custom_domains_operations.py index 8099c405051..709d7360cbc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -530,17 +492,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -561,23 +521,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -587,11 +546,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -608,14 +563,6 @@ def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -646,7 +593,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -657,17 +604,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -682,7 +625,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -708,18 +650,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -730,14 +671,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -747,11 +688,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -762,7 +703,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_gateway_route_configs_operations.py index 6c7f9c0b8bd..9588b3dfb77 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload def begin_create_or_update( self, @@ -388,14 +377,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -410,7 +391,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -429,18 +410,10 @@ def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -471,20 +444,9 @@ def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -521,7 +483,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -533,17 +495,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -564,23 +524,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -590,11 +549,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -611,14 +566,6 @@ def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -649,7 +596,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -660,17 +607,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -685,7 +628,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -711,18 +653,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -733,14 +674,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -750,11 +691,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -765,7 +706,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_gateways_operations.py index 657424169d3..ca2a94f7d74 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -465,20 +438,9 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -526,17 +488,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -557,22 +517,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,11 +541,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -601,14 +556,6 @@ def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -638,7 +585,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -649,17 +596,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: @@ -670,7 +613,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.GatewayResource] @@ -695,17 +637,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -716,14 +657,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -733,11 +674,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -749,10 +690,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload def validate_domain( self, @@ -779,7 +716,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -791,7 +727,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -806,11 +742,10 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -822,7 +757,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -835,13 +770,9 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -871,7 +802,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -880,16 +811,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -901,10 +831,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_monitoring_settings_operations.py index 730e7a8d7ca..6f99c889350 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -442,23 +404,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -486,7 +446,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -494,16 +454,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -523,10 +482,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -550,14 +505,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +517,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -583,18 +530,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -607,7 +546,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -618,20 +557,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_01_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -666,7 +594,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -678,14 +606,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_operations.py index 98778934e95..626e3e613a3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_runtime_versions_operations.py index 23614f5187c..71e43711ef3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_service_registries_operations.py index a43d98526ee..aacc2ac0daf 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -217,22 +216,21 @@ def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,13 +242,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -271,22 +265,21 @@ def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +299,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -323,14 +312,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -375,17 +356,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -406,22 +385,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -431,11 +409,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -450,14 +424,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -487,7 +453,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -498,17 +464,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -521,7 +483,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -547,17 +508,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -568,14 +528,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -585,11 +545,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -600,7 +560,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_services_operations.py index af4048072b1..57918206d94 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -466,7 +466,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -487,21 +486,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -513,16 +511,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -549,7 +547,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -557,16 +555,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,10 +586,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -615,14 +608,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -635,7 +620,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -648,18 +633,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -669,7 +646,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -679,19 +660,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -726,7 +696,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -738,17 +708,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -769,21 +737,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,11 +760,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -808,14 +771,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -844,7 +799,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -855,20 +810,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -895,7 +850,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -903,16 +858,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -932,10 +886,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -958,14 +908,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -978,7 +920,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -991,18 +933,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1012,7 +946,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1021,20 +959,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1069,7 +996,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1081,17 +1008,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1102,7 +1027,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1123,21 +1047,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1149,13 +1072,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1180,7 +1099,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1191,7 +1109,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1204,11 +1122,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1219,7 +1136,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1230,13 +1147,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_01_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1266,7 +1179,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1274,16 +1187,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1295,13 +1207,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1314,7 +1222,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1335,21 +1242,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1359,11 +1265,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1374,7 +1276,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1395,21 +1296,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1421,13 +1321,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1448,35 +1344,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1487,14 +1378,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1523,7 +1406,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1534,17 +1417,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1565,35 +1444,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1604,14 +1478,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1640,7 +1506,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1651,17 +1517,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -1682,7 +1544,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1690,18 +1551,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1709,20 +1574,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2022_01_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_01_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1752,23 +1616,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1780,19 +1643,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceResource] @@ -1817,15 +1675,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1836,14 +1693,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1853,11 +1710,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1869,8 +1726,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1878,7 +1733,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.ServiceResource] @@ -1903,16 +1757,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1923,14 +1776,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1940,11 +1793,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1955,7 +1808,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_skus_operations.py index 155e9eba493..7523a322d3c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_storages_operations.py index 6761cf8349f..9008b740664 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_01_01_preview/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_01_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -359,14 +348,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -380,7 +361,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -395,18 +376,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -420,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -433,20 +406,9 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2022_01_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -482,7 +444,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -494,17 +456,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -525,22 +485,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -550,11 +509,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -569,14 +524,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -606,7 +553,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -617,17 +564,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -638,7 +581,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_01_01_preview.models.StorageResource] @@ -663,17 +605,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -684,14 +625,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -701,11 +642,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -716,7 +657,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/_app_platform_management_client.py index ddf91f71dcc..cd2de8976b9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -135,7 +137,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -207,7 +227,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2022-03-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -227,7 +247,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/_configuration.py index acc32c13541..b67ac6c140b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2022-03-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/_app_platform_management_client.py index 76a58dcb33d..7b837040768 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -135,7 +137,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -207,7 +227,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2022-03-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -227,7 +249,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/_configuration.py index f3c66788792..9c500943c8c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2022-03-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_api_portal_custom_domains_operations.py index e543e3ad550..2e5a247597d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -385,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -416,23 +376,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +401,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +418,6 @@ async def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -501,7 +448,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -513,17 +460,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -538,7 +481,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -564,18 +506,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -586,14 +527,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -603,11 +544,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -618,7 +559,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_api_portals_operations.py index 12e1d5f7214..fe6e34fd109 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,17 +330,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -399,22 +359,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,11 +383,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -443,14 +398,6 @@ async def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -492,17 +439,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -515,7 +458,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.ApiPortalResource] @@ -540,17 +482,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -561,14 +502,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -578,11 +519,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -594,10 +535,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload async def validate_domain( self, @@ -624,7 +561,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -636,7 +572,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -651,11 +587,10 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -667,7 +602,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -680,13 +615,9 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -716,7 +647,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -725,16 +656,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,10 +676,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_apps_operations.py index 3c14beda02c..8d57d34a1f2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,20 +133,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -176,7 +170,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -185,16 +179,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -217,10 +210,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -246,14 +235,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -267,7 +248,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -320,19 +293,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -368,7 +330,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -381,17 +343,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -412,22 +372,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +396,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -456,14 +411,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -493,7 +440,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -505,24 +452,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -550,7 +493,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -559,16 +502,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +530,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -617,14 +555,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -638,7 +568,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -653,18 +583,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -678,7 +600,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -690,20 +612,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -739,7 +650,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -752,17 +663,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -773,7 +682,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.AppResource] @@ -798,17 +706,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -819,14 +726,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -836,11 +743,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -852,10 +759,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -869,7 +772,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -890,22 +792,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -917,20 +818,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -958,7 +855,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -967,16 +864,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -996,10 +892,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -1026,14 +918,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1047,7 +931,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1062,18 +946,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1087,7 +963,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1100,20 +976,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1149,7 +1014,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1162,17 +1027,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1200,7 +1063,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1212,7 +1074,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1227,11 +1089,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1243,7 +1104,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1256,13 +1117,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1292,7 +1149,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1301,16 +1158,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1322,10 +1178,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_bindings_operations.py index 20adf0af54d..d0d543d13bc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -386,17 +348,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -417,23 +377,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -443,11 +402,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -464,14 +419,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -502,7 +449,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -514,17 +461,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -532,7 +475,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -560,7 +503,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -570,16 +513,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,10 +541,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -631,14 +569,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -653,7 +583,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -670,18 +600,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -696,7 +618,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -711,20 +633,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -761,7 +672,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -774,17 +685,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -799,7 +708,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.BindingResource] @@ -824,18 +732,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -846,14 +753,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -863,11 +770,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -878,7 +785,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_build_service_agent_pool_operations.py index 95623ba33de..a751ddde336 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -174,7 +168,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -195,23 +188,22 @@ async def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -223,13 +215,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -237,7 +225,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -265,7 +253,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -275,16 +263,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -304,10 +291,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -337,14 +320,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -359,7 +334,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +351,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -402,7 +369,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -417,20 +384,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -467,7 +423,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -480,14 +436,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_build_service_builder_operations.py index d62fd76f2e6..55f162f818a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -239,14 +228,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -261,7 +242,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -278,18 +259,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -304,7 +277,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -319,20 +292,9 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -369,7 +331,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -510,17 +457,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -535,7 +478,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.BuilderResource] @@ -560,18 +502,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -582,14 +523,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -599,11 +540,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -614,7 +555,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_build_service_operations.py index 82941416952..4df6c5129bd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildService] @@ -105,17 +104,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -126,14 +124,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -143,11 +141,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -159,10 +157,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -176,7 +170,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -197,22 +190,21 @@ async def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -224,13 +216,9 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -245,7 +233,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.Build] @@ -270,18 +257,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -292,14 +278,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -309,11 +295,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -325,10 +311,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -344,7 +326,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -365,23 +346,22 @@ async def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -393,13 +373,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -429,7 +405,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -442,7 +417,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -459,11 +434,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -476,7 +450,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -490,13 +464,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2022_03_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2022_03_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -526,7 +496,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -536,16 +506,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -565,10 +534,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -584,7 +549,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildResult] @@ -609,19 +573,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -632,14 +595,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -649,11 +612,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -665,10 +628,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -692,7 +651,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -713,7 +671,7 @@ async def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -721,16 +679,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -742,13 +699,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -773,7 +726,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -794,7 +746,7 @@ async def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -802,16 +754,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -823,13 +774,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -844,7 +791,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -865,22 +811,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -892,13 +837,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -913,7 +854,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -934,22 +874,21 @@ async def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -961,13 +900,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -984,7 +919,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1005,23 +939,22 @@ async def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1033,13 +966,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1054,7 +983,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1075,22 +1003,21 @@ async def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1102,13 +1029,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1125,7 +1048,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1146,23 +1068,22 @@ async def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,10 +1095,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_buildpack_binding_operations.py index b4a7b5c470d..cb93a5e96cb 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -85,7 +85,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -106,7 +105,7 @@ async def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -114,16 +113,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,13 +133,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -150,7 +144,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -178,7 +172,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -189,16 +183,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,10 +211,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -255,14 +244,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -278,7 +259,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -298,18 +279,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -325,7 +298,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -342,20 +315,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -393,7 +355,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -406,17 +368,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -443,7 +403,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -451,16 +411,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -470,11 +429,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -499,14 +454,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -538,7 +485,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -550,17 +497,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -577,7 +520,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -603,19 +545,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -626,14 +567,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -643,11 +584,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -658,7 +599,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_certificates_operations.py index 0d8441d4b82..906c870f71c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -371,17 +333,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -402,22 +362,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,11 +386,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -446,14 +401,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -483,7 +430,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -495,17 +442,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -518,7 +461,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.CertificateResource] @@ -543,17 +485,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +505,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -581,11 +522,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +537,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_config_servers_operations.py index 246b99a7aaf..602f7d84587 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -348,23 +310,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -392,7 +352,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -400,16 +360,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,10 +388,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -456,14 +411,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -476,7 +423,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -489,18 +436,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -513,7 +452,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -524,20 +463,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -572,7 +500,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,23 +513,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -629,7 +555,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -637,16 +563,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -666,10 +591,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -693,14 +614,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -713,7 +626,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -726,18 +639,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -750,7 +655,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -761,20 +666,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -809,7 +703,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -821,14 +715,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_configuration_services_operations.py index 63274bd5353..40833b37f2e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -310,20 +283,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -359,7 +321,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -372,17 +334,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -403,22 +363,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,11 +387,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -447,14 +402,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -484,7 +431,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -496,17 +443,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -519,7 +462,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -545,17 +487,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -566,14 +507,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -583,11 +524,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,16 +540,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -636,7 +573,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -645,16 +582,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -674,10 +610,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -703,14 +635,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -724,7 +648,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -739,18 +663,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -764,7 +680,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -777,20 +693,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -826,7 +731,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -838,14 +743,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_custom_domains_operations.py index d92bbd93109..584d12c8335 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -386,17 +348,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -417,23 +377,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -443,11 +402,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -464,14 +419,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -502,7 +449,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -514,17 +461,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -532,7 +475,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -560,7 +503,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -570,16 +513,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -599,10 +541,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -631,14 +569,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -653,7 +583,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -670,18 +600,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -696,7 +618,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -711,20 +633,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -761,7 +672,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -774,17 +685,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -799,7 +708,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -825,18 +733,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -847,14 +754,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -864,11 +771,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -879,7 +786,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_deployments_operations.py index 3df5dc5e50b..decc1c880dc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,13 +133,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -149,7 +143,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -177,7 +171,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -187,16 +181,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -219,10 +212,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -252,14 +241,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -274,7 +255,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -291,18 +272,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -317,7 +290,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -332,20 +305,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -382,7 +344,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -395,17 +357,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -426,23 +386,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -452,11 +411,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -473,14 +428,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -511,7 +458,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -523,17 +470,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -541,7 +484,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -569,7 +512,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -579,16 +522,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,10 +550,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -641,14 +579,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -663,7 +593,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -680,18 +610,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -706,7 +628,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -721,20 +643,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -771,7 +682,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -784,17 +695,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -816,7 +725,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.DeploymentResource] @@ -841,19 +749,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -864,14 +771,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -881,11 +788,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +804,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -914,7 +817,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.DeploymentResource] @@ -939,18 +841,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -961,14 +862,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -978,11 +879,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -994,10 +895,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1017,23 +914,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1043,11 +939,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1064,14 +956,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1102,7 +986,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1114,17 +998,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1145,23 +1025,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1171,11 +1050,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1192,14 +1067,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1230,7 +1097,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1242,17 +1109,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1273,23 +1136,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1299,11 +1161,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1320,14 +1178,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1358,7 +1208,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1370,17 +1220,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1397,7 +1243,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1418,23 +1263,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1448,13 +1292,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1462,7 +1302,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1490,7 +1330,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1500,16 +1340,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1519,11 +1358,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -1554,14 +1389,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1574,7 +1401,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1591,18 +1418,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1615,7 +1434,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -1630,20 +1449,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -1677,7 +1485,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1689,17 +1497,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1707,7 +1511,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1735,7 +1539,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1745,16 +1549,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1764,11 +1567,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -1799,14 +1598,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1819,7 +1610,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1836,18 +1627,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1860,7 +1643,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -1875,20 +1658,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -1922,7 +1694,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1934,17 +1706,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -1952,7 +1720,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1980,7 +1748,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1990,16 +1758,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2009,11 +1776,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2044,14 +1807,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2064,7 +1819,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2081,18 +1836,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2105,7 +1852,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2120,20 +1867,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2167,7 +1903,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -2179,14 +1915,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_gateway_custom_domains_operations.py index 75a0f5e841b..5881d1e0266 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -385,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -416,23 +376,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +401,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +418,6 @@ async def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -501,7 +448,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -513,17 +460,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -538,7 +481,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -564,18 +506,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -586,14 +527,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -603,11 +544,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -618,7 +559,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_gateway_route_configs_operations.py index e14eccb483b..d2a4eb94051 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -264,7 +245,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -283,18 +264,10 @@ async def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -309,7 +282,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -325,20 +298,9 @@ async def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -375,7 +337,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -388,17 +350,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -419,23 +379,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -445,11 +404,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -466,14 +421,6 @@ async def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -504,7 +451,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -516,17 +463,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -541,7 +484,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -567,18 +509,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -589,14 +530,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -606,11 +547,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -621,7 +562,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_gateways_operations.py index 8f3d1e5f44a..7c3cd308925 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,17 +330,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -399,22 +359,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,11 +383,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -443,14 +398,6 @@ async def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -492,17 +439,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -515,7 +458,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayResource] @@ -540,17 +482,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -561,14 +502,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -578,11 +519,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -594,10 +535,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload async def validate_domain( self, @@ -624,7 +561,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -636,7 +572,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -651,11 +587,10 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -667,7 +602,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -680,13 +615,9 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -716,7 +647,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -725,16 +656,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,10 +676,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_monitoring_settings_operations.py index beb7cc03147..054927973e1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -349,23 +311,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -393,7 +353,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -401,16 +361,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -430,10 +389,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -457,14 +412,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -477,7 +424,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -490,18 +437,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -514,7 +453,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -525,20 +464,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -573,7 +501,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +514,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_operations.py index 6d79c71b4a4..53ef6c6ed07 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_runtime_versions_operations.py index 7b82aa7e362..22e1b7ad982 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_service_registries_operations.py index 049d8742dce..512889e5d6d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,13 +120,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -149,22 +143,21 @@ async def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -184,10 +177,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -201,14 +190,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -241,7 +222,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -254,17 +235,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -285,22 +264,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -310,11 +288,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -329,14 +303,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -366,7 +332,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -378,17 +344,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -401,7 +363,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -427,17 +388,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -448,14 +408,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -465,11 +425,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -480,7 +440,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_services_operations.py index 782ef00ca43..c677c02db18 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -101,21 +100,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,16 +125,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -163,7 +161,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -171,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -229,14 +222,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -249,7 +234,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -262,18 +247,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -283,7 +260,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -293,19 +274,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -340,7 +310,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -353,17 +323,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -384,21 +352,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -408,11 +375,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -423,14 +386,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -459,7 +414,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -471,20 +426,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -511,7 +466,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -519,16 +474,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,10 +502,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -574,14 +524,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -594,7 +536,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -607,18 +549,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -628,7 +562,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -637,20 +575,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -685,7 +612,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -698,17 +625,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -719,7 +644,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -740,21 +664,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -766,13 +689,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -797,7 +716,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -808,7 +726,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -821,11 +739,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -836,7 +753,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -847,13 +764,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_03_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -883,7 +796,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -891,16 +804,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -912,13 +824,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -931,7 +839,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -952,21 +859,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -976,11 +882,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -993,7 +895,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1014,21 +915,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1040,13 +940,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1067,35 +963,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1106,14 +997,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1142,7 +1025,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1154,17 +1037,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1185,35 +1064,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1224,14 +1098,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1260,7 +1126,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1272,17 +1138,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -1303,7 +1165,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1311,18 +1172,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1330,20 +1195,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_03_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1373,23 +1237,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1401,19 +1264,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceResource] @@ -1438,15 +1296,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1457,14 +1314,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1474,11 +1331,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1490,8 +1347,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1499,7 +1354,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceResource] @@ -1524,16 +1378,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1544,14 +1397,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1561,11 +1414,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,7 +1429,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_skus_operations.py index 77b54e2d04c..6d87fa9b77a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_storages_operations.py index 4f1e66b83e0..edd0a4e005e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -270,18 +251,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -295,7 +268,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -308,20 +281,9 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -357,7 +319,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -370,17 +332,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -401,22 +361,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,11 +385,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -445,14 +400,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -482,7 +429,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -494,17 +441,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -517,7 +460,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.StorageResource] @@ -542,17 +484,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -563,14 +504,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -580,11 +521,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -595,7 +536,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/models/_models_py3.py index 0c18a25ddd5..164c868d141 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/models/_models_py3.py @@ -118,24 +118,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2022_03_01_preview.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class ApiPortalCustomDomainResource(ProxyResource): """Custom domain of the API portal. @@ -720,7 +702,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -773,7 +755,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -1572,7 +1554,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -1610,7 +1592,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -1979,7 +1961,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -2230,7 +2212,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -2529,7 +2511,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -2566,7 +2548,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -2878,7 +2860,7 @@ def __init__( self.git_property = git_property -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -2933,7 +2915,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3059,7 +3041,7 @@ def __init__( class CustomContainerUserSourceInfo(UserSourceInfo): """Custom container user source info. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -3210,7 +3192,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -3262,7 +3244,7 @@ def __init__(self, *, is_valid: Optional[bool] = None, message: Optional[str] = class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -4371,7 +4353,7 @@ def __init__( class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -4502,7 +4484,7 @@ class UploadedUserSourceInfo(UserSourceInfo): You probably want to use the sub-classes and not this class directly. Known sub-classes are: JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4545,7 +4527,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4601,7 +4583,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -4689,7 +4671,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -4723,7 +4705,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -5138,7 +5120,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -5171,7 +5153,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -5496,7 +5478,7 @@ def __init__(self, *, size_in_gb: Optional[int] = None, mount_path: Optional[str class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2022_03_01_preview.models.TestKeyType @@ -6312,7 +6294,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -6366,7 +6348,7 @@ def __init__( class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -6507,7 +6489,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2022_03_01_preview.models.StorageType @@ -6532,7 +6514,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2022_03_01_preview.models.StorageType diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_api_portal_custom_domains_operations.py index be178e1b2e5..caf4ce64335 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -530,17 +492,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -561,23 +521,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -587,11 +546,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -608,14 +563,6 @@ def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -646,7 +593,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -657,17 +604,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -682,7 +625,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -708,18 +650,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -730,14 +671,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -747,11 +688,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -762,7 +703,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_api_portals_operations.py index 9bdce99f46f..921b4a7e26f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -465,20 +438,9 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -526,17 +488,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -557,22 +517,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,11 +541,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -601,14 +556,6 @@ def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -638,7 +585,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -649,17 +596,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: @@ -670,7 +613,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.ApiPortalResource] @@ -695,17 +637,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -716,14 +657,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -733,11 +674,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -749,10 +690,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload def validate_domain( self, @@ -779,7 +716,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -791,7 +727,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -806,11 +742,10 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -822,7 +757,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -835,13 +770,9 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -871,7 +802,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -880,16 +811,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -901,10 +831,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_apps_operations.py index af82f1b85a9..16f92fb246d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -373,23 +372,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -401,20 +399,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -442,7 +436,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -451,16 +445,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -483,10 +476,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -512,14 +501,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -533,7 +514,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -548,18 +529,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -573,7 +546,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -586,19 +559,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -634,7 +596,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -646,17 +608,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -677,22 +637,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -702,11 +661,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -721,14 +676,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -758,7 +705,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -769,24 +716,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -814,7 +757,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -823,16 +766,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -852,10 +794,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -881,14 +819,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -902,7 +832,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -917,18 +847,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -942,7 +864,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -954,20 +876,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1003,7 +914,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1015,17 +926,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1036,7 +945,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.AppResource] @@ -1061,17 +969,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1082,14 +989,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1099,11 +1006,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1115,10 +1022,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1132,7 +1035,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1153,22 +1055,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1180,20 +1081,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1221,7 +1118,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1230,16 +1127,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1259,10 +1155,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1289,14 +1181,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1310,7 +1194,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1325,18 +1209,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1350,7 +1226,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1363,20 +1239,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1412,7 +1277,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1424,17 +1289,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1462,7 +1325,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1474,7 +1336,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1489,11 +1351,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1505,7 +1366,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1518,13 +1379,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1554,7 +1411,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1563,16 +1420,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1584,10 +1440,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_bindings_operations.py index a4766200855..4e959799a6f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -551,17 +513,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -582,23 +542,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,11 +567,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -629,14 +584,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -667,7 +614,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -678,17 +625,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -696,7 +639,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -724,7 +667,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -734,16 +677,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -763,10 +705,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -795,14 +733,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -817,7 +747,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -834,18 +764,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -860,7 +782,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -875,20 +797,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -925,7 +836,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -937,17 +848,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -962,7 +871,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.BindingResource] @@ -987,18 +895,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1009,14 +916,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1026,11 +933,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1041,7 +948,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_build_service_agent_pool_operations.py index ff9c835cfcd..8adca247149 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -209,18 +208,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -231,14 +229,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -248,11 +246,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -264,10 +262,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -283,7 +277,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -304,23 +297,22 @@ def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -332,13 +324,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -346,7 +334,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -374,7 +362,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -384,16 +372,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -413,10 +400,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -446,14 +429,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -468,7 +443,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -485,18 +460,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -511,7 +478,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -526,20 +493,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -576,7 +532,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -588,14 +544,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_build_service_builder_operations.py index 78ca027e4fa..bd6b0435107 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -385,14 +374,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -407,7 +388,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -424,18 +405,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -450,7 +423,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -465,20 +438,9 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -515,7 +477,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -527,17 +489,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -558,23 +518,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,11 +543,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -605,14 +560,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -643,7 +590,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -654,17 +601,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -679,7 +622,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.BuilderResource] @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_build_service_operations.py index b8a9974e927..dac48cd9828 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -532,7 +532,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildService] @@ -557,17 +556,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -578,14 +576,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -595,11 +593,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -611,10 +609,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -628,7 +622,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -649,22 +642,21 @@ def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -676,13 +668,9 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -697,7 +685,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -721,18 +708,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -743,14 +729,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -760,11 +746,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -776,10 +762,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -795,7 +777,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -816,23 +797,22 @@ def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -844,13 +824,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -880,7 +856,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -893,7 +868,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -910,11 +885,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -927,7 +901,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -941,13 +915,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2022_03_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2022_03_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -977,7 +947,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -987,16 +957,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1016,10 +985,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1035,7 +1000,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildResult] @@ -1060,19 +1024,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1083,14 +1046,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1100,11 +1063,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1116,10 +1079,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1143,7 +1102,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1164,7 +1122,7 @@ def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1172,16 +1130,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1193,13 +1150,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1224,7 +1177,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1245,7 +1197,7 @@ def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1253,16 +1205,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1274,13 +1225,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1295,7 +1242,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1316,22 +1262,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1343,13 +1288,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1364,7 +1305,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1385,22 +1325,21 @@ def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1412,13 +1351,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1435,7 +1370,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1456,23 +1390,22 @@ def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1484,13 +1417,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1505,7 +1434,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1526,22 +1454,21 @@ def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1553,13 +1480,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -1576,7 +1499,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1597,23 +1519,22 @@ def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1625,10 +1546,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_buildpack_binding_operations.py index 0cfe8c5fa84..eab56e8a2cd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -243,7 +243,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -264,7 +263,7 @@ def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -272,16 +271,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -308,7 +302,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -336,7 +330,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -347,16 +341,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -376,10 +369,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -413,14 +402,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -436,7 +417,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -456,18 +437,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -483,7 +456,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -500,20 +473,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -551,7 +513,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -563,17 +525,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -600,7 +560,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -608,16 +568,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -627,11 +586,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -656,14 +611,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -695,7 +642,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -706,17 +653,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -733,7 +676,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -759,19 +701,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -782,14 +723,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -799,11 +740,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -814,7 +755,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_certificates_operations.py index d6a0e992569..f3028cc4842 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -495,17 +457,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -526,22 +486,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -551,11 +510,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -570,14 +525,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -607,7 +554,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -618,17 +565,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -641,7 +584,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.CertificateResource] @@ -666,17 +608,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -687,14 +628,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -704,11 +645,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -719,7 +660,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_config_servers_operations.py index c5a2816ab1e..43874d71b7b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -476,23 +438,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -520,7 +480,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -528,16 +488,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -557,10 +516,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -584,14 +539,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -604,7 +551,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -617,18 +564,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -641,7 +580,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -652,20 +591,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -700,7 +628,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -712,23 +640,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -756,7 +682,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -764,16 +690,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,10 +718,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -820,14 +741,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -840,7 +753,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -853,18 +766,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -877,7 +782,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -888,20 +793,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -936,7 +830,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -948,14 +842,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_configuration_services_operations.py index ad4ee3d1ccc..1c1633b5249 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -393,14 +382,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -414,7 +395,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -430,18 +411,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -469,20 +442,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -530,17 +492,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -561,22 +521,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -586,11 +545,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -605,14 +560,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -642,7 +589,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -676,7 +619,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -702,17 +644,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -723,14 +664,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -740,11 +681,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -756,16 +697,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -793,7 +730,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -802,16 +739,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -831,10 +767,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -860,14 +792,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -881,7 +805,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -896,18 +820,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -921,7 +837,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -934,20 +850,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -983,7 +888,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -995,14 +900,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_custom_domains_operations.py index 2783069387a..1b1d128cd40 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -551,17 +513,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -582,23 +542,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,11 +567,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -629,14 +584,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -667,7 +614,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -678,17 +625,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -696,7 +639,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -724,7 +667,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -734,16 +677,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -763,10 +705,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -795,14 +733,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -817,7 +747,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -834,18 +764,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -860,7 +782,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -875,20 +797,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -925,7 +836,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -937,17 +848,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -962,7 +871,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -988,18 +896,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1010,14 +917,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1027,11 +934,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1042,7 +949,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_deployments_operations.py index c7d643867eb..f246a9c2ec7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -585,7 +585,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -606,23 +605,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -634,13 +632,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -648,7 +642,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -676,7 +670,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -686,16 +680,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -718,10 +711,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -751,14 +740,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -773,7 +754,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -790,18 +771,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -816,7 +789,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -831,20 +804,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -881,7 +843,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -893,17 +855,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -924,23 +884,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -950,11 +909,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -971,14 +926,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1009,7 +956,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1020,17 +967,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1038,7 +981,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1066,7 +1009,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1076,16 +1019,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1105,10 +1047,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1138,14 +1076,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1160,7 +1090,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1177,18 +1107,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1203,7 +1125,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1218,20 +1140,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1268,7 +1179,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1280,17 +1191,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1312,7 +1221,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.DeploymentResource] @@ -1337,19 +1245,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1360,14 +1267,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1377,11 +1284,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1393,10 +1300,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1410,7 +1313,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.DeploymentResource] @@ -1435,18 +1337,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1457,14 +1358,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1474,11 +1375,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1490,10 +1391,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1513,23 +1410,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1539,11 +1435,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1560,14 +1452,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1598,7 +1482,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1609,17 +1493,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1640,23 +1520,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1666,11 +1545,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1687,14 +1562,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1725,7 +1592,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1736,17 +1603,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1767,23 +1630,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1793,11 +1655,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1814,14 +1672,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1852,7 +1702,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1863,17 +1713,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def get_log_file_url( @@ -1890,7 +1736,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1911,23 +1756,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1941,13 +1785,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1955,7 +1795,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1983,7 +1823,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1993,16 +1833,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2012,11 +1851,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2047,14 +1882,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2067,7 +1894,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2084,18 +1911,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2108,7 +1927,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2123,20 +1942,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2170,7 +1978,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2181,17 +1989,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2199,7 +2003,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2227,7 +2031,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2237,16 +2041,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2256,11 +2059,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2291,14 +2090,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2311,7 +2102,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2328,18 +2119,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2352,7 +2135,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2367,20 +2150,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2414,7 +2186,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2425,17 +2197,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2443,7 +2211,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2471,7 +2239,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2481,16 +2249,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2500,11 +2267,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -2535,14 +2298,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2555,7 +2310,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2572,18 +2327,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2596,7 +2343,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -2611,20 +2358,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2658,7 +2394,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2669,14 +2405,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_gateway_custom_domains_operations.py index ceabd29cf2d..d6441bca0a3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -530,17 +492,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -561,23 +521,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -587,11 +546,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -608,14 +563,6 @@ def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -646,7 +593,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -657,17 +604,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -682,7 +625,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -708,18 +650,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -730,14 +671,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -747,11 +688,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -762,7 +703,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_gateway_route_configs_operations.py index 25debb3d1d0..ef6ca05e31a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload def begin_create_or_update( self, @@ -388,14 +377,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -410,7 +391,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -429,18 +410,10 @@ def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -471,20 +444,9 @@ def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -521,7 +483,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -533,17 +495,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -564,23 +524,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -590,11 +549,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -611,14 +566,6 @@ def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -649,7 +596,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -660,17 +607,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -685,7 +628,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -711,18 +653,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -733,14 +674,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -750,11 +691,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -765,7 +706,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_gateways_operations.py index 92af8ffffda..35815998161 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -465,20 +438,9 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -526,17 +488,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -557,22 +517,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,11 +541,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -601,14 +556,6 @@ def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -638,7 +585,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -649,17 +596,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: @@ -670,7 +613,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.GatewayResource] @@ -695,17 +637,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -716,14 +657,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -733,11 +674,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -749,10 +690,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload def validate_domain( self, @@ -779,7 +716,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -791,7 +727,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -806,11 +742,10 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -822,7 +757,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -835,13 +770,9 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -871,7 +802,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -880,16 +811,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -901,10 +831,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_monitoring_settings_operations.py index 44faf514a7b..967c3830d3b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -442,23 +404,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -486,7 +446,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -494,16 +454,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -523,10 +482,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -550,14 +505,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +517,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -583,18 +530,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -607,7 +546,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -618,20 +557,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_03_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -666,7 +594,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -678,14 +606,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_operations.py index 622dabca24f..046f3cb0b9b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_runtime_versions_operations.py index 592a9cb2c4e..e3a9d635db1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_service_registries_operations.py index 7c7db9d75cc..1ec4e8560d0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -217,22 +216,21 @@ def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,13 +242,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -271,22 +265,21 @@ def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +299,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -323,14 +312,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -375,17 +356,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -406,22 +385,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -431,11 +409,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -450,14 +424,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -487,7 +453,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -498,17 +464,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -521,7 +483,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -547,17 +508,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -568,14 +528,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -585,11 +545,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -600,7 +560,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_services_operations.py index 49b7382bae9..56af67b2618 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -466,7 +466,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -487,21 +486,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -513,16 +511,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -549,7 +547,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -557,16 +555,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,10 +586,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -615,14 +608,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -635,7 +620,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -648,18 +633,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -669,7 +646,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -679,19 +660,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -726,7 +696,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -738,17 +708,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -769,21 +737,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,11 +760,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -808,14 +771,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -844,7 +799,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -855,20 +810,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -895,7 +850,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -903,16 +858,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -932,10 +886,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -958,14 +908,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -978,7 +920,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -991,18 +933,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1012,7 +946,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1021,20 +959,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1069,7 +996,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1081,17 +1008,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1102,7 +1027,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1123,21 +1047,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1149,13 +1072,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1180,7 +1099,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1191,7 +1109,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1204,11 +1122,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1219,7 +1136,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1230,13 +1147,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_03_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1266,7 +1179,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1274,16 +1187,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1295,13 +1207,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1314,7 +1222,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1335,21 +1242,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1359,11 +1265,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1374,7 +1276,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1395,21 +1296,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1421,13 +1321,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1448,35 +1344,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1487,14 +1378,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1523,7 +1406,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1534,17 +1417,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1565,35 +1444,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1604,14 +1478,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1640,7 +1506,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1651,17 +1517,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -1682,7 +1544,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1690,18 +1551,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1709,20 +1574,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2022_03_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_03_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1752,23 +1616,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1780,19 +1643,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceResource] @@ -1817,15 +1675,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1836,14 +1693,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1853,11 +1710,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1869,8 +1726,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1878,7 +1733,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.ServiceResource] @@ -1903,16 +1757,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1923,14 +1776,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1940,11 +1793,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1955,7 +1808,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_skus_operations.py index 5de4d3385c7..9d19e6a5af8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_storages_operations.py index 840519f1749..bdfc916ab7c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_03_01_preview/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_03_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -359,14 +348,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -380,7 +361,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -395,18 +376,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -420,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -433,20 +406,9 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2022_03_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -482,7 +444,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -494,17 +456,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -525,22 +485,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -550,11 +509,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -569,14 +524,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -606,7 +553,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -617,17 +564,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -638,7 +581,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_03_01_preview.models.StorageResource] @@ -663,17 +605,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -684,14 +625,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -701,11 +642,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -716,7 +657,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/_app_platform_management_client.py index 7459b9924a1..08c17fa28c6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -108,7 +110,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -156,7 +176,7 @@ def __init__( ) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize, "2022-04-01") - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -176,7 +196,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/_configuration.py index 0b71bea2cf4..d594d536fc6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2022-04-01") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/_app_platform_management_client.py index 279f6f57aae..79322767450 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -111,7 +113,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -159,7 +179,9 @@ def __init__( ) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize, "2022-04-01") - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -179,7 +201,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/_configuration.py index f8661a77a78..a5d61df113a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2022-04-01") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_apps_operations.py index 9f4943664ca..715c4f7501e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -105,23 +104,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,20 +131,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -172,7 +166,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -181,16 +175,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -213,10 +206,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -278,18 +259,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -303,7 +276,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -316,19 +289,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_04_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_04_01.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -362,7 +324,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -372,17 +334,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -401,22 +361,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,11 +385,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -445,14 +400,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -489,24 +436,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -532,7 +475,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -541,16 +484,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -570,10 +512,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -599,14 +537,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -620,7 +550,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -635,18 +565,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -660,7 +582,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -672,20 +594,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_04_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_04_01.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -719,7 +630,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -729,17 +640,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -750,7 +659,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.AppResource] @@ -773,17 +681,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -794,14 +701,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -811,11 +718,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -827,10 +734,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -844,7 +747,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -863,22 +765,21 @@ async def get_resource_upload_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -890,20 +791,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -929,7 +826,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -938,16 +835,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -967,10 +863,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -997,14 +889,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1018,7 +902,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1033,18 +917,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1058,7 +934,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1071,20 +947,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2022_04_01.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_04_01.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1118,7 +983,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1128,17 +993,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1165,7 +1028,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1177,7 +1039,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1192,11 +1054,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1208,7 +1069,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1221,13 +1082,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1255,7 +1112,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1264,16 +1121,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1285,10 +1141,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_bindings_operations.py index 192b794f2c1..608e4648937 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,23 +96,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,13 +123,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -139,7 +133,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -239,14 +228,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -261,7 +242,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -278,18 +259,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -304,7 +277,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -319,19 +292,8 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2022_04_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + BindingResource type or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2022_04_01.models.BindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -366,7 +328,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -376,17 +338,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -405,23 +365,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -431,11 +390,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -452,14 +407,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -488,7 +435,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -497,17 +444,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -515,7 +458,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -541,7 +484,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -551,16 +494,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,10 +522,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -612,14 +550,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -634,7 +564,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -651,18 +581,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -677,7 +599,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -692,19 +614,8 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2022_04_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2022_04_01.models.BindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -739,7 +650,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -749,17 +660,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -774,7 +683,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.BindingResource] @@ -797,18 +705,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -819,14 +726,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -836,11 +743,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -851,7 +758,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_build_service_agent_pool_operations.py index a486a977faa..c5b9b3942ac 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -98,18 +97,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -172,7 +166,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,23 +184,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -219,13 +211,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -233,7 +221,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -259,7 +247,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -269,16 +257,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -298,10 +285,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -331,14 +314,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -353,7 +328,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -370,18 +345,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -396,7 +363,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -411,20 +378,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2022_04_01.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_04_01.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -459,7 +415,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -469,14 +425,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_build_service_builder_operations.py index c7e4f29fc57..95107412a58 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,23 +95,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,13 +122,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -138,7 +132,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -257,7 +238,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -274,18 +255,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -300,7 +273,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -315,19 +288,8 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. - :type builder_resource: ~azure.mgmt.appplatform.v2022_04_01.models.BuilderResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + BuilderResource type or a IO[bytes] type. Required. + :type builder_resource: ~azure.mgmt.appplatform.v2022_04_01.models.BuilderResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -362,7 +324,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -372,17 +334,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -401,23 +361,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,11 +386,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -448,14 +403,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -484,7 +431,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -493,17 +440,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -518,7 +461,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.BuilderResource] @@ -541,18 +483,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -563,14 +504,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -580,11 +521,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -595,7 +536,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_build_service_operations.py index e4c7f6174ab..f6c8498e986 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.BuildService] @@ -103,17 +102,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -124,14 +122,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -141,11 +139,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,10 +155,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -174,7 +168,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -193,22 +186,21 @@ async def get_build_service( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -220,13 +212,9 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -241,7 +229,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.Build] @@ -264,18 +251,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -286,14 +272,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -303,11 +289,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -319,10 +305,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -338,7 +320,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -357,23 +338,22 @@ async def get_build( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -385,13 +365,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -421,7 +397,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -434,7 +409,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -451,11 +426,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -468,7 +442,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -482,13 +456,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2022_04_01.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2022_04_01.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -516,7 +486,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -526,16 +496,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,10 +524,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -574,7 +539,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.BuildResult] @@ -597,19 +561,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -620,14 +583,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -637,11 +600,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -653,10 +616,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -680,7 +639,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -699,7 +657,7 @@ async def get_build_result( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -707,16 +665,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -728,13 +685,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -759,7 +712,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -778,7 +730,7 @@ async def get_build_result_log( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -786,16 +738,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -807,13 +758,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -828,7 +775,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -847,22 +793,21 @@ async def get_resource_upload_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -874,13 +819,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -895,7 +836,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -914,22 +854,21 @@ async def list_supported_buildpacks( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -941,13 +880,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -964,7 +899,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -983,23 +917,22 @@ async def get_supported_buildpack( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1011,13 +944,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1032,7 +961,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1051,22 +979,21 @@ async def list_supported_stacks( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1078,13 +1005,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1101,7 +1024,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1120,23 +1042,22 @@ async def get_supported_stack( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1148,10 +1069,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_buildpack_binding_operations.py index f4851145abb..ae050c18875 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -85,7 +85,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -104,7 +103,7 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -112,16 +111,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,13 +131,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -148,7 +142,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -174,7 +168,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -185,16 +179,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -214,10 +207,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -250,14 +239,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -273,7 +254,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -293,18 +274,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -320,7 +293,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -337,20 +310,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: ~azure.mgmt.appplatform.v2022_04_01.models.BuildpackBindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -386,7 +348,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -396,17 +358,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -431,7 +391,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -439,16 +399,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -458,11 +417,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -487,14 +442,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -524,7 +471,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -533,17 +480,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -560,7 +503,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -584,19 +526,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -607,14 +548,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -624,11 +565,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -639,7 +580,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_certificates_operations.py index 6629b0b419f..e0602cd1276 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -94,22 +93,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,20 +119,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -160,7 +154,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -169,16 +163,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -201,10 +194,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -230,14 +219,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -251,7 +232,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -266,18 +247,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -291,7 +264,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -304,20 +277,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: ~azure.mgmt.appplatform.v2022_04_01.models.CertificateResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -351,7 +313,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -361,17 +323,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -390,22 +350,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -415,11 +374,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -434,14 +389,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -469,7 +416,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -478,17 +425,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -501,7 +444,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.CertificateResource] @@ -524,17 +466,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -545,14 +486,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -562,11 +503,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -577,7 +518,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_config_servers_operations.py index 8754629fff8..4c3a8c3d916 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -87,21 +86,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -113,19 +111,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -151,7 +145,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -159,16 +153,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -188,10 +181,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -214,14 +203,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -234,7 +215,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -247,18 +228,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -271,7 +244,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -282,20 +255,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2022_04_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -328,7 +290,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -338,23 +300,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -380,7 +340,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -388,16 +348,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -417,10 +376,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -443,14 +398,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -463,7 +410,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -476,18 +423,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -500,7 +439,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -511,20 +450,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2022_04_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -557,7 +485,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -567,23 +495,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -609,7 +535,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -617,16 +543,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -646,10 +571,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -672,14 +593,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -692,7 +605,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -705,18 +618,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -729,7 +634,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -740,20 +645,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: ~azure.mgmt.appplatform.v2022_04_01.models.ConfigServerSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -786,7 +680,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -798,14 +692,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_configuration_services_operations.py index 1b4411c10bf..84e55cdc9af 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,20 +120,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -161,7 +155,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -170,16 +164,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -199,10 +192,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -230,14 +219,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -251,7 +232,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -267,18 +248,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -292,7 +265,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -306,20 +279,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2022_04_01.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_04_01.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -353,7 +315,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -363,17 +325,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -392,22 +352,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -417,11 +376,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -436,14 +391,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -471,7 +418,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -480,17 +427,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -503,7 +446,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -527,17 +469,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -548,14 +489,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -565,11 +506,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -581,16 +522,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -616,7 +553,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -625,16 +562,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -654,10 +590,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -683,14 +615,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -704,7 +628,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -719,18 +643,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -744,7 +660,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -757,19 +673,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. - :type settings: ~azure.mgmt.appplatform.v2022_04_01.models.ConfigurationServiceSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ConfigurationServiceSettings type or a IO[bytes] type. Required. + :type settings: ~azure.mgmt.appplatform.v2022_04_01.models.ConfigurationServiceSettings or + IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -803,7 +709,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -815,14 +721,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_custom_domains_operations.py index 0d8f8f916c1..7e7d1c13eaa 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,23 +96,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,13 +123,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -139,7 +133,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -239,14 +228,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -261,7 +242,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -278,18 +259,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -304,7 +277,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -319,19 +292,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -366,7 +329,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -376,17 +339,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -405,23 +366,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -431,11 +391,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -452,14 +408,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -488,7 +436,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -497,17 +445,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -515,7 +459,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -541,7 +485,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -551,16 +495,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,10 +523,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -612,14 +551,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -634,7 +565,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -651,18 +582,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -677,7 +600,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -692,19 +615,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -739,7 +652,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -749,17 +662,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -774,7 +685,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -798,18 +708,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -820,14 +729,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -837,11 +746,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -852,7 +761,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_deployments_operations.py index eae8013f194..a05dad8e72e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -105,23 +104,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,13 +131,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -147,7 +141,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -173,7 +167,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -183,16 +177,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -215,10 +208,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -247,14 +236,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -269,7 +250,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -286,18 +267,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -312,7 +285,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -327,19 +300,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2022_04_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + DeploymentResource type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2022_04_01.models.DeploymentResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -374,7 +337,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -384,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -413,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +416,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -496,7 +444,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -505,17 +453,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -523,7 +467,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -549,7 +493,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -559,16 +503,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +531,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -620,14 +559,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -642,7 +573,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -659,18 +590,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -685,7 +608,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -700,19 +623,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2022_04_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2022_04_01.models.DeploymentResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -747,7 +660,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -757,17 +670,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -789,7 +700,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.DeploymentResource] @@ -812,19 +722,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -835,14 +744,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -852,11 +761,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -868,10 +777,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -885,7 +790,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.DeploymentResource] @@ -908,18 +812,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -930,14 +833,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -947,11 +850,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -963,10 +866,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -984,23 +883,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1010,11 +908,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1031,14 +925,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1067,7 +953,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1076,17 +962,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1105,23 +987,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1131,11 +1012,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1152,14 +1029,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1188,7 +1057,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1197,17 +1066,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1226,23 +1091,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1252,11 +1116,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1273,14 +1133,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1309,7 +1161,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1318,17 +1170,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1345,7 +1193,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1364,23 +1211,22 @@ async def get_log_file_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1394,13 +1240,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1408,7 +1250,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1434,7 +1276,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1444,16 +1286,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1463,11 +1304,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -1497,14 +1334,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1517,7 +1346,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1534,18 +1363,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1558,7 +1379,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -1573,20 +1394,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2022_04_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -1618,7 +1428,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1627,17 +1437,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1645,7 +1451,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1671,7 +1477,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1681,16 +1487,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1700,11 +1505,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -1734,14 +1535,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1754,7 +1547,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1771,18 +1564,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1795,7 +1580,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -1810,20 +1595,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2022_04_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -1855,7 +1629,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1864,17 +1638,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -1882,7 +1652,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1908,7 +1678,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1918,16 +1688,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1937,11 +1706,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -1971,14 +1736,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1991,7 +1748,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2008,18 +1765,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2032,7 +1781,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2047,20 +1796,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2022_04_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -2092,7 +1830,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2101,14 +1839,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_monitoring_settings_operations.py index e65eea9f36a..f8c694842b9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -88,21 +87,20 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -114,19 +112,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -152,7 +146,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -160,16 +154,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -189,10 +182,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -216,14 +205,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -236,7 +217,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -249,18 +230,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -273,7 +246,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -284,20 +257,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_04_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_04_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -330,7 +292,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -340,23 +302,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -382,7 +342,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -390,16 +350,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -419,10 +378,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -446,14 +401,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -466,7 +413,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -479,18 +426,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -503,7 +442,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -514,20 +453,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_04_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_04_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -560,7 +488,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -570,14 +498,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_operations.py index 22af1f86cac..3c82f988d04 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.OperationDetail] @@ -80,14 +79,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -98,14 +96,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -115,11 +113,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -130,5 +128,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_runtime_versions_operations.py index b5f7d7ebc56..1e2e13c455e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -74,18 +73,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -97,8 +95,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_service_registries_operations.py index 81943571546..51db278d035 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -93,22 +92,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -120,13 +118,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -145,22 +139,21 @@ async def _create_or_update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -180,10 +173,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -197,14 +186,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -235,7 +216,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -245,17 +226,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -274,22 +253,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -299,11 +277,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -318,14 +292,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -353,7 +319,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -362,17 +328,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -385,7 +347,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -409,17 +370,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -430,14 +390,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -447,11 +407,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -462,7 +422,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_services_operations.py index b99666258bb..cf257110327 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,21 +96,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,16 +121,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -157,7 +155,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -165,16 +163,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -197,10 +194,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -223,14 +216,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -243,7 +228,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -256,18 +241,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -277,7 +254,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -287,19 +268,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_04_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_04_01.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -332,7 +302,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -342,17 +312,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -371,21 +339,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -395,11 +362,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -410,14 +373,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -444,7 +399,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -453,20 +408,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -491,7 +446,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -499,16 +454,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -528,10 +482,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -554,14 +504,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -574,7 +516,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -587,18 +529,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -608,7 +542,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -617,20 +555,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_04_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_04_01.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -663,7 +590,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -673,17 +600,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -694,7 +619,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -713,21 +637,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -739,13 +662,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -770,7 +689,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -781,7 +699,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -794,11 +712,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -809,7 +726,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -820,13 +737,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2022_04_01.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_04_01.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -854,7 +767,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -862,16 +775,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -883,13 +795,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -902,7 +810,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -921,21 +828,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -945,11 +851,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -962,7 +864,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -981,21 +882,20 @@ async def enable_test_endpoint( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1007,13 +907,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore @overload async def check_name_availability( @@ -1034,7 +930,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1042,18 +937,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1061,20 +960,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2022_04_01.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_04_01.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1102,23 +1000,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1130,19 +1027,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.ServiceResource] @@ -1165,15 +1057,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1184,14 +1075,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1201,11 +1092,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1217,8 +1108,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1226,7 +1115,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.ServiceResource] @@ -1249,16 +1137,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1269,14 +1156,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1286,11 +1173,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1301,7 +1188,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_skus_operations.py index 1d1bce3c09a..cb00425eec7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.ResourceSku] @@ -80,15 +79,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -99,14 +97,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -116,11 +114,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -131,5 +129,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/models/_models_py3.py index bebd014dd6d..b31723b88ec 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/models/_models_py3.py @@ -121,24 +121,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2022_04_01.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class AppResource(ProxyResource): """App resource payload. @@ -1114,7 +1096,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -1148,7 +1130,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -1514,7 +1496,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -1760,7 +1742,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: list[~azure.mgmt.appplatform.v2022_04_01.models.GitPatternRepository] @@ -2053,7 +2035,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -2090,7 +2072,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -2397,7 +2379,7 @@ def __init__( self.git_property = git_property -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -2432,7 +2414,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -2599,7 +2581,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -2955,7 +2937,7 @@ def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -3060,7 +3042,7 @@ class UploadedUserSourceInfo(UserSourceInfo): You probably want to use the sub-classes and not this class directly. Known sub-classes are: JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -3103,7 +3085,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -3159,7 +3141,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3247,7 +3229,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -3281,7 +3263,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -3685,7 +3667,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -3718,7 +3700,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4041,7 +4023,7 @@ def __init__(self, *, size_in_gb: Optional[int] = None, mount_path: Optional[str class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2022_04_01.models.TestKeyType @@ -4844,7 +4826,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -4898,7 +4880,7 @@ def __init__( class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_apps_operations.py index cc73d2e1fd5..9d3224fef5d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -371,23 +370,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -399,20 +397,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -438,7 +432,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -447,16 +441,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -479,10 +472,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -508,14 +497,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_04_01.models.AppResource] @@ -528,7 +509,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -543,18 +524,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_04_01.models.AppResource] @@ -567,7 +540,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -580,19 +553,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_04_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_04_01.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_04_01.models.AppResource] @@ -625,7 +587,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -635,17 +597,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -664,22 +624,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -689,11 +648,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -708,14 +663,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -743,7 +690,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -752,24 +699,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -795,7 +738,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -804,16 +747,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -833,10 +775,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -862,14 +800,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_04_01.models.AppResource] @@ -882,7 +812,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -897,18 +827,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_04_01.models.AppResource] @@ -921,7 +843,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -933,20 +855,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_04_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_04_01.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_04_01.models.AppResource] @@ -979,7 +890,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -989,17 +900,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1010,7 +919,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.AppResource] :raises ~azure.core.exceptions.HttpResponseError: @@ -1032,17 +940,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1053,14 +960,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1070,11 +977,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1086,10 +993,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1103,7 +1006,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1122,22 +1024,21 @@ def get_resource_upload_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1149,20 +1050,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1188,7 +1085,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1197,16 +1094,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1226,10 +1122,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1256,14 +1148,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_04_01.models.AppResource] @@ -1276,7 +1160,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1291,18 +1175,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_04_01.models.AppResource] @@ -1315,7 +1191,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1328,20 +1204,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2022_04_01.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_04_01.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_04_01.models.AppResource] @@ -1374,7 +1239,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1384,17 +1249,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1421,7 +1284,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1433,7 +1295,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1448,11 +1310,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1464,7 +1325,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1477,13 +1338,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1511,7 +1368,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1520,16 +1377,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1541,10 +1397,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_bindings_operations.py index ed624af98cd..ea046be42b1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -263,23 +262,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,13 +289,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -305,7 +299,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -331,7 +325,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -341,16 +335,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -373,10 +366,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -405,14 +394,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -427,7 +408,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -444,18 +425,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -470,7 +443,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -485,19 +458,8 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2022_04_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + BindingResource type or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2022_04_01.models.BindingResource or IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -532,7 +494,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -542,17 +504,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -571,23 +531,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -597,11 +556,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -618,14 +573,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -654,7 +601,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -663,17 +610,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -681,7 +624,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -707,7 +650,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -717,16 +660,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,10 +688,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -778,14 +716,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -800,7 +730,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -817,18 +747,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -843,7 +765,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -858,19 +780,8 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2022_04_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2022_04_01.models.BindingResource or IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -905,7 +816,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -915,17 +826,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -940,7 +849,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.BindingResource] @@ -963,18 +871,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -985,14 +892,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1002,11 +909,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1017,7 +924,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_build_service_agent_pool_operations.py index e9b11e46617..969b71417ab 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -207,18 +206,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -229,14 +227,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -246,11 +244,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -262,10 +260,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -281,7 +275,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -300,23 +293,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -328,13 +320,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -342,7 +330,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -368,7 +356,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -378,16 +366,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -407,10 +394,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -440,14 +423,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -462,7 +437,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -479,18 +454,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -505,7 +472,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -520,20 +487,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2022_04_01.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_04_01.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -568,7 +524,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -578,14 +534,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_build_service_builder_operations.py index a37254dd408..d77ba01e0eb 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -242,23 +241,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -270,13 +268,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -284,7 +278,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -310,7 +304,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -320,16 +314,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,10 +342,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -381,14 +370,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -403,7 +384,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -420,18 +401,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -446,7 +419,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -461,19 +434,8 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. - :type builder_resource: ~azure.mgmt.appplatform.v2022_04_01.models.BuilderResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + BuilderResource type or a IO[bytes] type. Required. + :type builder_resource: ~azure.mgmt.appplatform.v2022_04_01.models.BuilderResource or IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -508,7 +470,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -518,17 +480,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -547,23 +507,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -573,11 +532,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -594,14 +549,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -630,7 +577,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -639,17 +586,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -664,7 +607,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.BuilderResource] @@ -687,18 +629,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -709,14 +650,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -726,11 +667,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -741,7 +682,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_build_service_operations.py index 87cf07b9670..77740287109 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -532,7 +532,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.BuildService] :raises ~azure.core.exceptions.HttpResponseError: @@ -554,17 +553,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -575,14 +573,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -592,11 +590,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,10 +606,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -625,7 +619,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -644,22 +637,21 @@ def get_build_service( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -671,13 +663,9 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -692,7 +680,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -714,18 +701,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -736,14 +722,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -753,11 +739,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -769,10 +755,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -788,7 +770,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -807,23 +788,22 @@ def get_build( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -835,13 +815,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -871,7 +847,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -884,7 +859,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -901,11 +876,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -918,7 +892,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -932,13 +906,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2022_04_01.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2022_04_01.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -966,7 +936,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -976,16 +946,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1005,10 +974,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1024,7 +989,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.BuildResult] :raises ~azure.core.exceptions.HttpResponseError: @@ -1046,19 +1010,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1069,14 +1032,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1086,11 +1049,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1102,10 +1065,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1129,7 +1088,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1148,7 +1106,7 @@ def get_build_result( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1156,16 +1114,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1177,13 +1134,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1208,7 +1161,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1227,7 +1179,7 @@ def get_build_result_log( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1235,16 +1187,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1256,13 +1207,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1277,7 +1224,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1296,22 +1242,21 @@ def get_resource_upload_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1323,13 +1268,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1344,7 +1285,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1363,22 +1303,21 @@ def list_supported_buildpacks( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1390,13 +1329,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1413,7 +1348,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1432,23 +1366,22 @@ def get_supported_buildpack( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1460,13 +1393,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1481,7 +1410,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1500,22 +1428,21 @@ def list_supported_stacks( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1527,13 +1454,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -1550,7 +1473,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1569,23 +1491,22 @@ def get_supported_stack( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1597,10 +1518,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_buildpack_binding_operations.py index 41babf2a0e8..d332e64f887 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -243,7 +243,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -262,7 +261,7 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -270,16 +269,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,13 +289,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -306,7 +300,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -332,7 +326,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -343,16 +337,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -372,10 +365,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -408,14 +397,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -451,18 +432,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -478,7 +451,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -495,20 +468,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: ~azure.mgmt.appplatform.v2022_04_01.models.BuildpackBindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -544,7 +506,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -554,17 +516,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -589,7 +549,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -597,16 +557,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -616,11 +575,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -645,14 +600,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -682,7 +629,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -691,17 +638,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -718,7 +661,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -742,19 +684,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -765,14 +706,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -782,11 +723,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -797,7 +738,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_certificates_operations.py index 3353e5c2856..2dcc88c4f61 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -219,22 +218,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -246,20 +244,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -285,7 +279,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -294,16 +288,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -326,10 +319,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -355,14 +344,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -376,7 +357,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -391,18 +372,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -416,7 +389,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -429,20 +402,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: ~azure.mgmt.appplatform.v2022_04_01.models.CertificateResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -476,7 +438,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -486,17 +448,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -515,22 +475,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -540,11 +499,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -559,14 +514,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -594,7 +541,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -603,17 +550,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -626,7 +569,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.CertificateResource] @@ -649,17 +591,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -670,14 +611,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -687,11 +628,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -702,7 +643,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_config_servers_operations.py index 95f8c5c6c8b..3dd4eee0785 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -216,21 +215,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -242,19 +240,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -280,7 +274,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -288,16 +282,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -317,10 +310,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -343,14 +332,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +357,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -400,7 +373,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -411,20 +384,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2022_04_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -457,7 +419,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -467,23 +429,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -509,7 +469,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -517,16 +477,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -546,10 +505,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -572,14 +527,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -592,7 +539,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -605,18 +552,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -629,7 +568,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -640,20 +579,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2022_04_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -686,7 +614,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -696,23 +624,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -738,7 +664,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -746,16 +672,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -775,10 +700,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -801,14 +722,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -821,7 +734,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -834,18 +747,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -858,7 +763,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -869,20 +774,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: ~azure.mgmt.appplatform.v2022_04_01.models.ConfigServerSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -915,7 +809,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -927,14 +821,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_configuration_services_operations.py index a5f4c8a47c0..d78a36660e1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -254,22 +253,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -281,20 +279,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -320,7 +314,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -329,16 +323,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -358,10 +351,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -389,14 +378,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -410,7 +391,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -426,18 +407,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -451,7 +424,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -465,20 +438,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2022_04_01.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_04_01.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -512,7 +474,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -522,17 +484,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -551,22 +511,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -576,11 +535,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -595,14 +550,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -630,7 +577,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -639,17 +586,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -662,7 +605,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -686,17 +628,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -707,14 +648,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -724,11 +665,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,16 +681,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -775,7 +712,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -784,16 +721,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -813,10 +749,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -842,14 +774,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -863,7 +787,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -878,18 +802,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -903,7 +819,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -916,19 +832,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. - :type settings: ~azure.mgmt.appplatform.v2022_04_01.models.ConfigurationServiceSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ConfigurationServiceSettings type or a IO[bytes] type. Required. + :type settings: ~azure.mgmt.appplatform.v2022_04_01.models.ConfigurationServiceSettings or + IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -962,7 +868,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -974,14 +880,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_custom_domains_operations.py index 725685d43c3..e8751183d45 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -263,23 +262,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,13 +289,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -305,7 +299,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -331,7 +325,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -341,16 +335,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -373,10 +366,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -405,14 +394,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -427,7 +408,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -444,18 +425,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -470,7 +443,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -485,19 +458,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainResource or + IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -532,7 +495,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -542,17 +505,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -571,23 +532,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -597,11 +557,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -618,14 +574,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -654,7 +602,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -663,17 +611,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -681,7 +625,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -707,7 +651,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -717,16 +661,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,10 +689,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -778,14 +717,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -800,7 +731,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -817,18 +748,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -843,7 +766,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -858,19 +781,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2022_04_01.models.CustomDomainResource or + IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -905,7 +818,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -915,17 +828,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -940,7 +851,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -964,18 +874,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -986,14 +895,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1003,11 +912,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1018,7 +927,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_deployments_operations.py index f64c54d3bf4..0b7c6e57256 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -585,7 +585,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -604,23 +603,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -632,13 +630,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -646,7 +640,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -672,7 +666,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -682,16 +676,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -714,10 +707,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -746,14 +735,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -768,7 +749,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -785,18 +766,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -811,7 +784,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -826,19 +799,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2022_04_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + DeploymentResource type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2022_04_01.models.DeploymentResource or + IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -873,7 +836,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -883,17 +846,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -912,23 +873,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -938,11 +898,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -959,14 +915,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -995,7 +943,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1004,17 +952,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1022,7 +966,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1048,7 +992,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1058,16 +1002,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1087,10 +1030,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1119,14 +1058,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1141,7 +1072,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1158,18 +1089,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1184,7 +1107,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1199,19 +1122,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2022_04_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2022_04_01.models.DeploymentResource or + IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1246,7 +1159,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1256,17 +1169,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1288,7 +1199,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.DeploymentResource] @@ -1311,19 +1221,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1334,14 +1243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1351,11 +1260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1367,10 +1276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1384,7 +1289,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.DeploymentResource] @@ -1407,18 +1311,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1429,14 +1332,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1446,11 +1349,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1462,10 +1365,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1483,23 +1382,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1509,11 +1407,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1530,14 +1424,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1566,7 +1452,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1575,17 +1461,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1604,23 +1486,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1630,11 +1511,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1651,14 +1528,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1687,7 +1556,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1696,17 +1565,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1725,23 +1590,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1751,11 +1615,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1772,14 +1632,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1808,7 +1660,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1817,17 +1669,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def get_log_file_url( @@ -1844,7 +1692,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1863,23 +1710,22 @@ def get_log_file_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1893,13 +1739,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1907,7 +1749,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1933,7 +1775,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1943,16 +1785,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1962,11 +1803,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -1996,14 +1833,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2016,7 +1845,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2033,18 +1862,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2057,7 +1878,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2072,20 +1893,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2022_04_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -2117,7 +1927,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2126,17 +1936,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2144,7 +1950,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2170,7 +1976,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2180,16 +1986,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2199,11 +2004,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2233,14 +2034,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2253,7 +2046,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2270,18 +2063,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2294,7 +2079,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2309,20 +2094,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2022_04_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -2354,7 +2128,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2363,17 +2137,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2381,7 +2151,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2407,7 +2177,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2417,16 +2187,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2436,11 +2205,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -2470,14 +2235,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2490,7 +2247,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2507,18 +2264,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2531,7 +2280,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -2546,20 +2295,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2022_04_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -2591,7 +2329,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2600,14 +2338,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_monitoring_settings_operations.py index 96a9c4b6eef..b6feabcc3d3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -182,21 +181,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,19 +206,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -246,7 +240,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -254,16 +248,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,10 +276,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -310,14 +299,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -330,7 +311,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -343,18 +324,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -367,7 +340,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -378,20 +351,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_04_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_04_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -424,7 +386,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -434,23 +396,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -476,7 +436,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -484,16 +444,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -513,10 +472,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -540,14 +495,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -560,7 +507,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -573,18 +520,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -597,7 +536,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -608,20 +547,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_04_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_04_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -654,7 +582,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -664,14 +592,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_operations.py index 4cafb5bfecb..035faaf92d7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.OperationDetail] @@ -102,14 +101,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -137,11 +135,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -152,5 +150,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_runtime_versions_operations.py index 27e11f2fdfb..b0cf8821b4a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -96,18 +95,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -119,8 +117,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_service_registries_operations.py index 14d5d7926b4..a94e89c14e0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -215,22 +214,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -242,13 +240,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -267,22 +261,21 @@ def _create_or_update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -302,10 +295,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -319,14 +308,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -357,7 +338,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -367,17 +348,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -396,22 +375,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +399,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -440,14 +414,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -475,7 +441,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -484,17 +450,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -507,7 +469,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -531,17 +492,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -552,14 +512,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -569,11 +529,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,7 +544,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_services_operations.py index 9ac838e4637..78fe4407c63 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -406,7 +406,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -425,21 +424,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -451,16 +449,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -485,7 +483,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -493,16 +491,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -525,10 +522,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -551,14 +544,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -571,7 +556,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -584,18 +569,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -605,7 +582,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -615,19 +596,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_04_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_04_01.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -660,7 +630,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -670,17 +640,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -699,21 +667,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -723,11 +690,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -738,14 +701,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -772,7 +727,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -781,20 +736,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -819,7 +774,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -827,16 +782,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -856,10 +810,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -882,14 +832,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -902,7 +844,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -915,18 +857,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -936,7 +870,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -945,20 +883,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_04_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_04_01.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -991,7 +918,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1001,17 +928,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1022,7 +947,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1041,21 +965,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1067,13 +990,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1098,7 +1017,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1109,7 +1027,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1122,11 +1040,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1137,7 +1054,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1148,13 +1065,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2022_04_01.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_04_01.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1182,7 +1095,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1190,16 +1103,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1211,13 +1123,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1230,7 +1138,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1249,21 +1156,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1273,11 +1179,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1288,7 +1190,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1307,21 +1208,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1333,13 +1233,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore @overload def check_name_availability( @@ -1360,7 +1256,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1368,18 +1263,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1387,20 +1286,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2022_04_01.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_04_01.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_04_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1428,23 +1326,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1456,19 +1353,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.ServiceResource] @@ -1491,15 +1383,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1510,14 +1401,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1527,11 +1418,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1543,8 +1434,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1552,7 +1441,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.ServiceResource] @@ -1575,16 +1463,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1595,14 +1482,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1612,11 +1499,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1627,7 +1514,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_skus_operations.py index e4c6b1b93e8..2ded84ffafe 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_04_01/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_04_01.models.ResourceSku] :raises ~azure.core.exceptions.HttpResponseError: @@ -106,15 +105,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -125,14 +123,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -142,11 +140,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,5 +155,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/_app_platform_management_client.py index 78739bc1287..512924935f4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -135,7 +137,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -207,7 +227,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2022-05-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -227,7 +247,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/_configuration.py index b2978d2b99e..b1c4d1b9d77 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2022-05-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/_app_platform_management_client.py index 8cf981084f1..612505544a1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -135,7 +137,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -207,7 +227,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2022-05-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -227,7 +249,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/_configuration.py index 79d14f51652..7110f3b6162 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2022-05-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_api_portal_custom_domains_operations.py index 5a50728235e..32b49c7c7ad 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_api_portals_operations.py index 132296accba..80589eac112 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -365,17 +327,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -396,22 +356,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -440,14 +395,6 @@ async def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -477,7 +424,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -486,17 +433,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -509,7 +452,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.ApiPortalResource] @@ -534,17 +476,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -555,14 +496,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -572,11 +513,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +529,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload async def validate_domain( self, @@ -618,7 +555,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -630,7 +566,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -645,11 +581,10 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -661,7 +596,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -674,13 +609,9 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -710,7 +641,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -719,16 +650,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,10 +670,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_apps_operations.py index 38389ed2d29..37f00e3d062 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,20 +133,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -176,7 +170,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -185,16 +179,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -217,10 +210,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -246,14 +235,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -267,7 +248,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -320,19 +293,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -368,7 +330,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -378,17 +340,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -409,22 +369,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,11 +393,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -453,14 +408,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -490,7 +437,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -499,24 +446,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -544,7 +487,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -553,16 +496,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,10 +524,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -611,14 +549,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -632,7 +562,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -647,18 +577,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -672,7 +594,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -684,20 +606,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -733,7 +644,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -743,17 +654,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -764,7 +673,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.AppResource] @@ -789,17 +697,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -810,14 +717,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -827,11 +734,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -843,10 +750,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -860,7 +763,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -881,22 +783,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -908,20 +809,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -949,7 +846,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -958,16 +855,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -987,10 +883,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -1017,14 +909,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1038,7 +922,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1053,18 +937,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1078,7 +954,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1091,20 +967,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1140,7 +1005,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1150,17 +1015,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1188,7 +1051,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1200,7 +1062,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1215,11 +1077,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1231,7 +1092,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1244,13 +1105,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1280,7 +1137,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1289,16 +1146,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1310,10 +1166,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_bindings_operations.py index f3d90bbdf15..8c2d5a66059 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -705,20 +627,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.BindingResource] @@ -815,18 +723,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -837,14 +744,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -854,11 +761,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -869,7 +776,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_build_service_agent_pool_operations.py index 653b5ba873e..a7f3d41b5b9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -174,7 +168,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -195,23 +188,22 @@ async def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -223,13 +215,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -237,7 +225,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -265,7 +253,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -275,16 +263,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -304,10 +291,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -337,14 +320,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -359,7 +334,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +351,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -402,7 +369,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -417,20 +384,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -467,7 +423,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -477,14 +433,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_build_service_builder_operations.py index 2afaae52e20..7214cf460d0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -239,14 +228,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -261,7 +242,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -278,18 +259,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -304,7 +277,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -319,20 +292,9 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -369,7 +331,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -379,17 +341,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -410,23 +370,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -436,11 +395,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -457,14 +412,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -495,7 +442,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -504,17 +451,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -529,7 +472,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.BuilderResource] @@ -554,18 +496,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -576,14 +517,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -593,11 +534,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,7 +549,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_build_service_operations.py index 1c760943035..58631cff3bc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildService] @@ -105,17 +104,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -126,14 +124,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -143,11 +141,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -159,10 +157,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -176,7 +170,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -197,22 +190,21 @@ async def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -224,13 +216,9 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -245,7 +233,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.Build] @@ -270,18 +257,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -292,14 +278,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -309,11 +295,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -325,10 +311,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -344,7 +326,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -365,23 +346,22 @@ async def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -393,13 +373,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -429,7 +405,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -442,7 +417,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -459,11 +434,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -476,7 +450,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -490,13 +464,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -526,7 +496,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -536,16 +506,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -565,10 +534,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -584,7 +549,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildResult] @@ -609,19 +573,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -632,14 +595,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -649,11 +612,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -665,10 +628,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -692,7 +651,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -713,7 +671,7 @@ async def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -721,16 +679,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -742,13 +699,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -773,7 +726,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -794,7 +746,7 @@ async def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -802,16 +754,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -823,13 +774,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -844,7 +791,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -865,22 +811,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -892,13 +837,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -913,7 +854,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -934,22 +874,21 @@ async def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -961,13 +900,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -984,7 +919,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1005,23 +939,22 @@ async def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1033,13 +966,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1054,7 +983,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1075,22 +1003,21 @@ async def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1102,13 +1029,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1125,7 +1048,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1146,23 +1068,22 @@ async def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,10 +1095,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_buildpack_binding_operations.py index 95e0a2f5533..abf54536930 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -85,7 +85,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -106,7 +105,7 @@ async def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -114,16 +113,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,13 +133,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -150,7 +144,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -178,7 +172,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -189,16 +183,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,10 +211,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -255,14 +244,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -278,7 +259,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -298,18 +279,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -325,7 +298,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -342,20 +315,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -393,7 +355,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -403,17 +365,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -440,7 +400,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -448,16 +408,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -467,11 +426,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -496,14 +451,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -535,7 +482,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -544,17 +491,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -571,7 +514,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -597,19 +539,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -620,14 +561,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -637,11 +578,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -652,7 +593,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_certificates_operations.py index 6b93ce43a11..8161ec22e76 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,17 +330,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -399,22 +359,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,11 +383,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -443,14 +398,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -489,17 +436,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -512,7 +455,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.CertificateResource] @@ -537,17 +479,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -558,14 +499,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -575,11 +516,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -590,7 +531,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_config_servers_operations.py index 0e7a040df0a..615e0696d56 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -345,23 +307,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -389,7 +349,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -397,16 +357,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,10 +385,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -453,14 +408,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -473,7 +420,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -486,18 +433,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -510,7 +449,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -521,20 +460,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -569,7 +497,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -579,23 +507,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -623,7 +549,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -631,16 +557,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -660,10 +585,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -687,14 +608,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -707,7 +620,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -720,18 +633,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -744,7 +649,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -755,20 +660,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -803,7 +697,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -815,14 +709,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_configuration_services_operations.py index fcc548262b5..a23393fe15e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -310,20 +283,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -359,7 +321,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -369,17 +331,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -400,22 +360,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -425,11 +384,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -444,14 +399,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -481,7 +428,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -490,17 +437,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -513,7 +456,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -539,17 +481,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -560,14 +501,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -577,11 +518,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,16 +534,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -630,7 +567,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -639,16 +576,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -668,10 +604,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -697,14 +629,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -718,7 +642,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -733,18 +657,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -758,7 +674,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -771,20 +687,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -820,7 +725,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -832,14 +737,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_custom_domains_operations.py index 87431902431..3d3f3852b1e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -705,20 +627,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -816,18 +724,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -838,14 +745,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -855,11 +762,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -870,7 +777,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_deployments_operations.py index 8098018e962..d146518c9de 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,13 +133,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -149,7 +143,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -177,7 +171,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -187,16 +181,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -219,10 +212,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -252,14 +241,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -274,7 +255,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -291,18 +272,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -317,7 +290,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -332,20 +305,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -382,7 +344,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -392,17 +354,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -423,23 +383,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,11 +408,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -470,14 +425,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -508,7 +455,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -517,17 +464,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -535,7 +478,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -563,7 +506,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -573,16 +516,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -602,10 +544,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -635,14 +573,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -657,7 +587,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -674,18 +604,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -700,7 +622,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -715,20 +637,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -765,7 +676,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -775,17 +686,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -807,7 +716,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.DeploymentResource] @@ -832,19 +740,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -855,14 +762,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -872,11 +779,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -888,10 +795,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -905,7 +808,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.DeploymentResource] @@ -930,18 +832,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -952,14 +853,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -969,11 +870,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -985,10 +886,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1008,23 +905,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1034,11 +930,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1055,14 +947,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1093,7 +977,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1102,17 +986,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1133,23 +1013,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1159,11 +1038,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1180,14 +1055,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1218,7 +1085,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1227,17 +1094,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1258,23 +1121,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1284,11 +1146,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1305,14 +1163,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1343,7 +1193,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1352,17 +1202,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1379,7 +1225,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1400,23 +1245,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1430,13 +1274,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1444,7 +1284,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1472,7 +1312,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1482,16 +1322,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1501,11 +1340,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -1536,14 +1371,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1556,7 +1383,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1573,18 +1400,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1597,7 +1416,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -1612,20 +1431,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -1659,7 +1467,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1668,17 +1476,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1686,7 +1490,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1714,7 +1518,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1724,16 +1528,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1743,11 +1546,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -1778,14 +1577,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1798,7 +1589,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1815,18 +1606,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1839,7 +1622,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -1854,20 +1637,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -1901,7 +1673,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1910,17 +1682,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -1928,7 +1696,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1956,7 +1724,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1966,16 +1734,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1985,11 +1752,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2020,14 +1783,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2040,7 +1795,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2057,18 +1812,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2081,7 +1828,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2096,20 +1843,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2143,7 +1879,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2152,14 +1888,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_gateway_custom_domains_operations.py index 38fbb93dca6..fac89d77bef 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_gateway_route_configs_operations.py index 95097ea4975..87f72e07cf7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -264,7 +245,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -283,18 +264,10 @@ async def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -309,7 +282,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -325,20 +298,9 @@ async def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -375,7 +337,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -385,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -416,23 +376,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +401,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +418,6 @@ async def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -501,7 +448,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -510,17 +457,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -535,7 +478,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -561,18 +503,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -583,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -600,11 +541,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -615,7 +556,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_gateways_operations.py index 51ec1c51756..cc77ce40bf8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -365,17 +327,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -396,22 +356,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -440,14 +395,6 @@ async def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -477,7 +424,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -486,17 +433,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -509,7 +452,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayResource] @@ -534,17 +476,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -555,14 +496,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -572,11 +513,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +529,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload async def validate_domain( self, @@ -618,7 +555,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -630,7 +566,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -645,11 +581,10 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -661,7 +596,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -674,13 +609,9 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -710,7 +641,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -719,16 +650,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,10 +670,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_monitoring_settings_operations.py index 852cfa38756..ae1ec1536bd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -346,23 +308,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -390,7 +350,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -398,16 +358,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,10 +386,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -454,14 +409,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -474,7 +421,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -487,18 +434,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -511,7 +450,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -522,20 +461,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +498,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -580,14 +508,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_operations.py index 379384018f0..b4ec90eff74 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_runtime_versions_operations.py index c00f3e616e2..432caa532f4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_registries_operations.py index a419876e6aa..fc7e5f260d1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,13 +120,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -149,22 +143,21 @@ async def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -184,10 +177,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -201,14 +190,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -241,7 +222,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -251,17 +232,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -282,22 +261,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,11 +285,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -326,14 +300,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -363,7 +329,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -372,17 +338,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -395,7 +357,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -421,17 +382,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -442,14 +402,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -459,11 +419,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -474,7 +434,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_services_operations.py index b0ba47f6038..eb683b4c8e8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -101,21 +100,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,16 +125,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -163,7 +161,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -171,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -229,14 +222,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -249,7 +234,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -262,18 +247,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -283,7 +260,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -293,19 +274,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -340,7 +310,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -350,17 +320,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -381,21 +349,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -405,11 +372,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -420,14 +383,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -456,7 +411,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -465,20 +420,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -505,7 +460,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -513,16 +468,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -542,10 +496,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -568,14 +518,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -588,7 +530,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -601,18 +543,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -622,7 +556,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -631,20 +569,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -679,7 +606,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -689,17 +616,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -710,7 +635,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -731,21 +655,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -757,13 +680,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -788,7 +707,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -799,7 +717,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -812,11 +730,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -827,7 +744,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -838,13 +755,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_05_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -874,7 +787,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -882,16 +795,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -903,13 +815,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -922,7 +830,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -943,21 +850,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -967,11 +873,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -984,7 +886,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1005,21 +906,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1031,13 +931,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1058,35 +954,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1097,14 +988,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1133,7 +1016,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1142,17 +1025,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1173,35 +1052,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1212,14 +1086,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1248,7 +1114,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1257,17 +1123,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -1288,7 +1150,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1296,18 +1157,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1315,20 +1180,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_05_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1358,23 +1222,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1386,19 +1249,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceResource] @@ -1423,15 +1281,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1442,14 +1299,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1459,11 +1316,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1475,8 +1332,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1484,7 +1339,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceResource] @@ -1509,16 +1363,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1529,14 +1382,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1546,11 +1399,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1561,7 +1414,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_skus_operations.py index 0fdf880189c..bc059db7cd8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_storages_operations.py index 69f5b9398d8..6f6d851fbc1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -270,18 +251,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -295,7 +268,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -308,20 +281,9 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -357,7 +319,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -367,17 +329,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -398,22 +358,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -423,11 +382,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -442,14 +397,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -479,7 +426,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -488,17 +435,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -511,7 +454,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.StorageResource] @@ -536,17 +478,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -557,14 +498,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -574,11 +515,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,7 +530,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/models/_models_py3.py index baa95c32e0b..378cb63f193 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/models/_models_py3.py @@ -118,24 +118,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class ApiPortalCustomDomainResource(ProxyResource): """Custom domain of the API portal. @@ -760,7 +742,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -813,7 +795,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -1655,7 +1637,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -1693,7 +1675,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2062,7 +2044,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -2340,7 +2322,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -2639,7 +2621,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -2676,7 +2658,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -2988,7 +2970,7 @@ def __init__( self.git_property = git_property -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -3043,7 +3025,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3175,7 +3157,7 @@ def __init__( class CustomContainerUserSourceInfo(UserSourceInfo): """Custom container user source info. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -3333,7 +3315,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -3385,7 +3367,7 @@ def __init__(self, *, is_valid: Optional[bool] = None, message: Optional[str] = class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -3812,7 +3794,7 @@ class ProbeAction(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ExecAction, HTTPGetAction, TCPSocketAction - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -3840,7 +3822,7 @@ def __init__(self, **kwargs: Any) -> None: class ExecAction(ProbeAction): """ExecAction describes a "run in container" action. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -4653,7 +4635,7 @@ def __init__( class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -4755,7 +4737,7 @@ def __init__( class HTTPGetAction(ProbeAction): """HTTPGetAction describes an action based on HTTP Get requests. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -4861,7 +4843,7 @@ class UploadedUserSourceInfo(UserSourceInfo): You probably want to use the sub-classes and not this class directly. Known sub-classes are: JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4904,7 +4886,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4960,7 +4942,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -5054,7 +5036,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -5088,7 +5070,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -5542,7 +5524,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -5575,7 +5557,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -5909,7 +5891,7 @@ class Probe(_serialization.Model): """Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive traffic. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar probe_action: The action of the probe. :vartype probe_action: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ProbeAction @@ -5991,7 +5973,7 @@ def __init__( class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2022_05_01_preview.models.TestKeyType @@ -6829,7 +6811,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -6883,7 +6865,7 @@ def __init__( class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7024,7 +7006,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2022_05_01_preview.models.StorageType @@ -7049,7 +7031,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2022_05_01_preview.models.StorageType @@ -7478,7 +7460,7 @@ def __init__( class TCPSocketAction(ProbeAction): """TCPSocketAction describes an action based on opening a socket. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_api_portal_custom_domains_operations.py index 6d6577fd152..aed5d1abcee 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_api_portals_operations.py index e12bdcc7610..35efb3ccd91 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -465,20 +438,9 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -524,17 +486,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -555,22 +515,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,11 +539,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -599,14 +554,6 @@ def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -636,7 +583,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,17 +592,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: @@ -666,7 +609,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.ApiPortalResource] @@ -691,17 +633,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -712,14 +653,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -729,11 +670,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -745,10 +686,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload def validate_domain( self, @@ -775,7 +712,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -787,7 +723,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -802,11 +738,10 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -818,7 +753,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -831,13 +766,9 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -867,7 +798,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -876,16 +807,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +827,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_apps_operations.py index da2b973ca42..35638e3912d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -373,23 +372,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -401,20 +399,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -442,7 +436,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -451,16 +445,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -483,10 +476,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -512,14 +501,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -533,7 +514,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -548,18 +529,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -573,7 +546,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -586,19 +559,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -634,7 +596,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -644,17 +606,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -675,22 +635,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -700,11 +659,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -719,14 +674,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -756,7 +703,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -765,24 +712,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -810,7 +753,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -819,16 +762,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -848,10 +790,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -877,14 +815,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -898,7 +828,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -913,18 +843,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -938,7 +860,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -950,20 +872,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -999,7 +910,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1009,17 +920,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1030,7 +939,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.AppResource] @@ -1055,17 +963,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1076,14 +983,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1093,11 +1000,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1109,10 +1016,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1126,7 +1029,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1147,22 +1049,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,20 +1075,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1215,7 +1112,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1224,16 +1121,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1253,10 +1149,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1283,14 +1175,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1304,7 +1188,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1319,18 +1203,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1344,7 +1220,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1357,20 +1233,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1406,7 +1271,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1416,17 +1281,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1454,7 +1317,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1466,7 +1328,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1481,11 +1343,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1497,7 +1358,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1510,13 +1371,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1546,7 +1403,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1555,16 +1412,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,10 +1432,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_bindings_operations.py index ca3e69373c4..de603c54e78 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -871,20 +793,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.BindingResource] @@ -981,18 +889,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +910,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1020,11 +927,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1035,7 +942,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_build_service_agent_pool_operations.py index 46b6206c499..d60cf6df797 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -209,18 +208,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -231,14 +229,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -248,11 +246,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -264,10 +262,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -283,7 +277,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -304,23 +297,22 @@ def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -332,13 +324,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -346,7 +334,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -374,7 +362,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -384,16 +372,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -413,10 +400,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -446,14 +429,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -468,7 +443,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -485,18 +460,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -511,7 +478,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -526,20 +493,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -576,7 +532,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +542,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_build_service_builder_operations.py index 22af5df5c36..92f22b3a11f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -385,14 +374,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -407,7 +388,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -424,18 +405,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -450,7 +423,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -465,20 +438,9 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -515,7 +477,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -525,17 +487,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -556,23 +516,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,11 +541,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -603,14 +558,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -641,7 +588,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -650,17 +597,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -675,7 +618,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.BuilderResource] @@ -700,18 +642,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -722,14 +663,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -739,11 +680,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -754,7 +695,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_build_service_operations.py index 8e9c0c1f762..dcbcb8eb25c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -532,7 +532,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildService] @@ -557,17 +556,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -578,14 +576,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -595,11 +593,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -611,10 +609,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -628,7 +622,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -649,22 +642,21 @@ def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -676,13 +668,9 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -697,7 +685,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -721,18 +708,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -743,14 +729,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -760,11 +746,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -776,10 +762,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -795,7 +777,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -816,23 +797,22 @@ def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -844,13 +824,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -880,7 +856,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -893,7 +868,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -910,11 +885,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -927,7 +901,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -941,13 +915,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -977,7 +947,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -987,16 +957,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1016,10 +985,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1035,7 +1000,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildResult] @@ -1060,19 +1024,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1083,14 +1046,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1100,11 +1063,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1116,10 +1079,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1143,7 +1102,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1164,7 +1122,7 @@ def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1172,16 +1130,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1193,13 +1150,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1224,7 +1177,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1245,7 +1197,7 @@ def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1253,16 +1205,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1274,13 +1225,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1295,7 +1242,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1316,22 +1262,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1343,13 +1288,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1364,7 +1305,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1385,22 +1325,21 @@ def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1412,13 +1351,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1435,7 +1370,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1456,23 +1390,22 @@ def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1484,13 +1417,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1505,7 +1434,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1526,22 +1454,21 @@ def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1553,13 +1480,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -1576,7 +1499,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1597,23 +1519,22 @@ def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1625,10 +1546,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_buildpack_binding_operations.py index 78803cdfe44..bb01c0c005e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -243,7 +243,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -264,7 +263,7 @@ def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -272,16 +271,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -308,7 +302,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -336,7 +330,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -347,16 +341,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -376,10 +369,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -413,14 +402,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -436,7 +417,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -456,18 +437,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -483,7 +456,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -500,20 +473,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -551,7 +513,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -561,17 +523,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -598,7 +558,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -606,16 +566,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -625,11 +584,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -654,14 +609,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -693,7 +640,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -702,17 +649,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -729,7 +672,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -755,19 +697,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -778,14 +719,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -795,11 +736,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -810,7 +751,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_certificates_operations.py index 4eeb0b27507..8aeb49095e9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -493,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -524,22 +484,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -549,11 +508,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -568,14 +523,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -605,7 +552,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -614,17 +561,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -637,7 +580,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.CertificateResource] @@ -662,17 +604,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -683,14 +624,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -700,11 +641,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -715,7 +656,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_config_servers_operations.py index 9e74a1e7a6f..3f00de907e0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -474,23 +436,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -518,7 +478,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -526,16 +486,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,10 +514,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -582,14 +537,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -602,7 +549,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -615,18 +562,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -639,7 +578,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -650,20 +589,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -698,7 +626,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -708,23 +636,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -752,7 +678,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -760,16 +686,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -789,10 +714,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -816,14 +737,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -836,7 +749,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -849,18 +762,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -873,7 +778,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -884,20 +789,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -932,7 +826,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -944,14 +838,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_configuration_services_operations.py index d37d8c07290..6840d37bfcc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -393,14 +382,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -414,7 +395,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -430,18 +411,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -469,20 +442,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -559,22 +519,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,11 +543,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -603,14 +558,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -640,7 +587,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -649,17 +596,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -672,7 +615,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -698,17 +640,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -719,14 +660,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -736,11 +677,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -752,16 +693,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -789,7 +726,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -798,16 +735,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -827,10 +763,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -856,14 +788,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -877,7 +801,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -892,18 +816,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -917,7 +833,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -930,20 +846,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -979,7 +884,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -991,14 +896,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_custom_domains_operations.py index e7498030976..3b65edc1325 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -871,20 +793,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -982,18 +890,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1004,14 +911,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1021,11 +928,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,7 +943,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_deployments_operations.py index 98664ccd8ca..771c9338510 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -585,7 +585,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -606,23 +605,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -634,13 +632,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -648,7 +642,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -676,7 +670,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -686,16 +680,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -718,10 +711,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -751,14 +740,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -773,7 +754,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -790,18 +771,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -816,7 +789,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -831,20 +804,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -881,7 +843,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -891,17 +853,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -922,23 +882,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -948,11 +907,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -969,14 +924,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1007,7 +954,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1016,17 +963,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1034,7 +977,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1062,7 +1005,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1072,16 +1015,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1101,10 +1043,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1134,14 +1072,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1156,7 +1086,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1173,18 +1103,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1199,7 +1121,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1214,20 +1136,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1264,7 +1175,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1274,17 +1185,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1306,7 +1215,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.DeploymentResource] @@ -1331,19 +1239,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1354,14 +1261,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1371,11 +1278,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1387,10 +1294,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1404,7 +1307,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.DeploymentResource] @@ -1429,18 +1331,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1451,14 +1352,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1468,11 +1369,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1484,10 +1385,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1507,23 +1404,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1533,11 +1429,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1554,14 +1446,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1592,7 +1476,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1601,17 +1485,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1632,23 +1512,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1658,11 +1537,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1679,14 +1554,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1717,7 +1584,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1726,17 +1593,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1757,23 +1620,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1783,11 +1645,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1804,14 +1662,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1842,7 +1692,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1851,17 +1701,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def get_log_file_url( @@ -1878,7 +1724,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1899,23 +1744,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1929,13 +1773,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1943,7 +1783,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1971,7 +1811,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1981,16 +1821,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2000,11 +1839,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2035,14 +1870,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2055,7 +1882,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2072,18 +1899,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2096,7 +1915,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2111,20 +1930,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2158,7 +1966,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2167,17 +1975,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2185,7 +1989,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2213,7 +2017,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2223,16 +2027,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2242,11 +2045,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2277,14 +2076,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2297,7 +2088,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2314,18 +2105,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2338,7 +2121,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2353,20 +2136,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2400,7 +2172,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2409,17 +2181,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2427,7 +2195,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2455,7 +2223,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2465,16 +2233,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2484,11 +2251,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -2519,14 +2282,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2539,7 +2294,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2556,18 +2311,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2580,7 +2327,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -2595,20 +2342,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2642,7 +2378,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2651,14 +2387,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_gateway_custom_domains_operations.py index 84db3423bd6..1fc0760d6ba 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_gateway_route_configs_operations.py index 33de8c1d472..4f666836200 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload def begin_create_or_update( self, @@ -388,14 +377,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -410,7 +391,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -429,18 +410,10 @@ def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -471,20 +444,9 @@ def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -521,7 +483,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -531,17 +493,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -562,23 +522,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,11 +547,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -609,14 +564,6 @@ def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -647,7 +594,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -656,17 +603,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -681,7 +624,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -707,18 +649,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -729,14 +670,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -746,11 +687,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -761,7 +702,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_gateways_operations.py index 74ba409b0a1..ed56cb799e3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -465,20 +438,9 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -524,17 +486,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -555,22 +515,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,11 +539,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -599,14 +554,6 @@ def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -636,7 +583,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,17 +592,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: @@ -666,7 +609,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.GatewayResource] @@ -691,17 +633,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -712,14 +653,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -729,11 +670,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -745,10 +686,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload def validate_domain( self, @@ -775,7 +712,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -787,7 +723,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -802,11 +738,10 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -818,7 +753,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -831,13 +766,9 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -867,7 +798,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -876,16 +807,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +827,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_monitoring_settings_operations.py index 9aec1759f6a..8bbdf988379 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -440,23 +402,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -484,7 +444,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -492,16 +452,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -521,10 +480,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -548,14 +503,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -568,7 +515,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +528,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -605,7 +544,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -616,20 +555,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_05_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -664,7 +592,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -674,14 +602,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_operations.py index 19fa532d272..33ccf0a0a9f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_runtime_versions_operations.py index 31c6b358f58..e23775d7b78 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_service_registries_operations.py index 00a3b35c6d3..e940c6387fd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -217,22 +216,21 @@ def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,13 +242,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -271,22 +265,21 @@ def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +299,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -323,14 +312,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -373,17 +354,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -404,22 +383,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,11 +407,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -448,14 +422,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -485,7 +451,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -494,17 +460,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -517,7 +479,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -543,17 +504,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -581,11 +541,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +556,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_services_operations.py index acb258451f3..6a4d9004bf4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -466,7 +466,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -487,21 +486,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -513,16 +511,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -549,7 +547,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -557,16 +555,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,10 +586,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -615,14 +608,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -635,7 +620,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -648,18 +633,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -669,7 +646,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -679,19 +660,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -726,7 +696,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -736,17 +706,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -767,21 +735,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -791,11 +758,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -806,14 +769,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -842,7 +797,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -851,20 +806,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -891,7 +846,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -899,16 +854,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -928,10 +882,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -954,14 +904,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -974,7 +916,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -987,18 +929,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1008,7 +942,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1017,20 +955,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1065,7 +992,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1075,17 +1002,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1096,7 +1021,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1117,21 +1041,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1143,13 +1066,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1174,7 +1093,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1185,7 +1103,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1198,11 +1116,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1213,7 +1130,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1224,13 +1141,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_05_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1260,7 +1173,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1268,16 +1181,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1289,13 +1201,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1308,7 +1216,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1329,21 +1236,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1353,11 +1259,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1368,7 +1270,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1389,21 +1290,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1415,13 +1315,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1442,35 +1338,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1481,14 +1372,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1517,7 +1400,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1526,17 +1409,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1557,35 +1436,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1596,14 +1470,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1632,7 +1498,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1641,17 +1507,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -1672,7 +1534,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1680,18 +1541,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1699,20 +1564,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_05_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1742,23 +1606,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1770,19 +1633,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceResource] @@ -1807,15 +1665,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1826,14 +1683,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1843,11 +1700,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1859,8 +1716,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1868,7 +1723,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceResource] @@ -1893,16 +1747,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1913,14 +1766,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1930,11 +1783,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1945,7 +1798,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_skus_operations.py index 0a6c67b5bb8..f18ea486970 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_storages_operations.py index ad08e699d96..62f9f0ed1d0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_05_01_preview/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -359,14 +348,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -380,7 +361,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -395,18 +376,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -420,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -433,20 +406,9 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2022_05_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -482,7 +444,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -492,17 +454,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -523,22 +483,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +507,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -567,14 +522,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -604,7 +551,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -613,17 +560,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -634,7 +577,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.StorageResource] @@ -659,17 +601,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -680,14 +621,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -697,11 +638,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -712,7 +653,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/_app_platform_management_client.py index f163c31ca10..1f3c1e6cb0c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -135,7 +137,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -207,7 +227,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2022-09-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -227,7 +247,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/_configuration.py index 40520b6d2ee..1e864089d7c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2022-09-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/_app_platform_management_client.py index 6f83942f953..3a02055bdc2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -135,7 +137,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -207,7 +227,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2022-09-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -227,7 +249,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/_configuration.py index f514324b793..a8f7f81d045 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2022-09-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_api_portal_custom_domains_operations.py index 8fbd121934c..be5339203a5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_api_portals_operations.py index 642e7525137..3d312879246 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -365,17 +327,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -396,22 +356,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -440,14 +395,6 @@ async def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -477,7 +424,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -486,17 +433,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -509,7 +452,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.ApiPortalResource] @@ -534,17 +476,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -555,14 +496,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -572,11 +513,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +529,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload async def validate_domain( self, @@ -618,7 +555,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -630,7 +566,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -645,11 +581,10 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -661,7 +596,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -674,13 +609,9 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -710,7 +641,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -719,16 +650,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,10 +670,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_apps_operations.py index 79e80358758..28d2fbadf80 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,20 +133,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -176,7 +170,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -185,16 +179,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -217,10 +210,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -246,14 +235,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -267,7 +248,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -320,19 +293,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -368,7 +330,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -378,17 +340,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -409,22 +369,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,11 +393,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -453,14 +408,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -490,7 +437,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -499,24 +446,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -544,7 +487,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -553,16 +496,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,10 +524,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -611,14 +549,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -632,7 +562,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -647,18 +577,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -672,7 +594,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -684,20 +606,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -733,7 +644,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -743,17 +654,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -764,7 +673,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.AppResource] @@ -789,17 +697,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -810,14 +717,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -827,11 +734,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -843,10 +750,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -860,7 +763,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -881,22 +783,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -908,20 +809,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -949,7 +846,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -958,16 +855,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -987,10 +883,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -1017,14 +909,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1038,7 +922,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1053,18 +937,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1078,7 +954,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1091,20 +967,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1140,7 +1005,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1150,17 +1015,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1188,7 +1051,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1200,7 +1062,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1215,11 +1077,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1231,7 +1092,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1244,13 +1105,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1280,7 +1137,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1289,16 +1146,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1310,10 +1166,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_bindings_operations.py index ddef3005318..bdf307f4b67 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -705,20 +627,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.BindingResource] @@ -815,18 +723,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -837,14 +744,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -854,11 +761,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -869,7 +776,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_build_service_agent_pool_operations.py index 6f614e598a1..8275f97c5d3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -174,7 +168,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -195,23 +188,22 @@ async def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -223,13 +215,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -237,7 +225,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -265,7 +253,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -275,16 +263,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -304,10 +291,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -337,14 +320,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -359,7 +334,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +351,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -402,7 +369,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -417,20 +384,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -467,7 +423,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -477,14 +433,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_build_service_builder_operations.py index c36653f7175..4b3c6585275 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,10 +201,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -240,14 +229,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -262,7 +243,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -279,18 +260,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -305,7 +278,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -320,20 +293,9 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -370,7 +332,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -380,17 +342,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -411,23 +371,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +396,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -458,14 +413,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -496,7 +443,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -505,17 +452,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -530,7 +473,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.BuilderResource] @@ -555,18 +497,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -577,14 +518,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -594,11 +535,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -610,10 +551,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace_async async def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -629,7 +566,6 @@ async def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -650,23 +586,22 @@ async def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -678,10 +613,6 @@ async def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_build_service_operations.py index 6ddface58fa..d8d509d621b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildService] @@ -105,17 +104,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -126,14 +124,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -143,11 +141,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -159,10 +157,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -176,7 +170,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -197,22 +190,21 @@ async def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -224,13 +216,9 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -245,7 +233,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.Build] @@ -270,18 +257,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -292,14 +278,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -309,11 +295,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -325,10 +311,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -344,7 +326,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -365,23 +346,22 @@ async def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -393,13 +373,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -429,7 +405,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -442,7 +417,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -459,11 +434,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -476,7 +450,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -490,13 +464,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2022_09_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2022_09_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -526,7 +496,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -536,16 +506,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -565,10 +534,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -584,7 +549,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildResult] @@ -609,19 +573,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -632,14 +595,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -649,11 +612,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -665,10 +628,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -692,7 +651,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -713,7 +671,7 @@ async def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -721,16 +679,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -742,13 +699,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -773,7 +726,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -794,7 +746,7 @@ async def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -802,16 +754,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -823,13 +774,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -844,7 +791,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -865,22 +811,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -892,13 +837,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -913,7 +854,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -934,22 +874,21 @@ async def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -961,13 +900,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -984,7 +919,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1005,23 +939,22 @@ async def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1033,13 +966,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1054,7 +983,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1075,22 +1003,21 @@ async def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1102,13 +1029,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1125,7 +1048,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1146,23 +1068,22 @@ async def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,10 +1095,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_buildpack_binding_operations.py index 242d96c6e8c..a413464a1c6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -85,7 +85,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -106,7 +105,7 @@ async def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -114,16 +113,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,13 +133,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -150,7 +144,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -178,7 +172,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -189,16 +183,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,10 +211,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -255,14 +244,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -278,7 +259,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -298,18 +279,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -325,7 +298,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -342,20 +315,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -393,7 +355,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -403,17 +365,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -440,7 +400,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -448,16 +408,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -467,11 +426,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -496,14 +451,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -535,7 +482,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -544,17 +491,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -571,7 +514,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -597,19 +539,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -620,14 +561,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -637,11 +578,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -652,7 +593,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_certificates_operations.py index 1986477e55d..41a78fb768c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,17 +330,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -399,22 +359,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,11 +383,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -443,14 +398,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -489,17 +436,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -512,7 +455,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.CertificateResource] @@ -537,17 +479,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -558,14 +499,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -575,11 +516,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -590,7 +531,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_config_servers_operations.py index 4473ca56488..91b161f7572 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -345,23 +307,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -389,7 +349,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -397,16 +357,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,10 +385,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -453,14 +408,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -473,7 +420,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -486,18 +433,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -510,7 +449,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -521,20 +460,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -569,7 +497,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -579,23 +507,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -623,7 +549,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -631,16 +557,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -660,10 +585,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -687,14 +608,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -707,7 +620,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -720,18 +633,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -744,7 +649,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -755,20 +660,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -803,7 +697,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -815,14 +709,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_configuration_services_operations.py index cef4b5f3305..cc8639042ab 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -310,20 +283,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -359,7 +321,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -369,17 +331,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -400,22 +360,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -425,11 +384,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -444,14 +399,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -481,7 +428,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -490,17 +437,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -513,7 +456,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -539,17 +481,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -560,14 +501,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -577,11 +518,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,16 +534,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -630,7 +567,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -639,16 +576,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -668,10 +604,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -697,14 +629,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -718,7 +642,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -733,18 +657,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -758,7 +674,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -771,20 +687,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -820,7 +725,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -832,14 +737,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_custom_domains_operations.py index 848d01933b6..d04814322d1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -705,20 +627,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -816,18 +724,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -838,14 +745,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -855,11 +762,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -870,7 +777,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_deployments_operations.py index 9bd6b0d4cfa..879465f258c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -89,7 +89,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -110,23 +109,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -138,13 +136,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -152,7 +146,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -180,7 +174,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -190,16 +184,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -222,10 +215,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -255,14 +244,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -277,7 +258,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -294,18 +275,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -320,7 +293,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -335,20 +308,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -385,7 +347,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -395,17 +357,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -426,23 +386,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -452,11 +411,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -473,14 +428,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -511,7 +458,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -520,17 +467,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -538,7 +481,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -566,7 +509,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -576,16 +519,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -605,10 +547,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -638,14 +576,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -660,7 +590,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -677,18 +607,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -703,7 +625,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -718,20 +640,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -768,7 +679,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -778,17 +689,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -810,7 +719,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentResource] @@ -835,19 +743,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -858,14 +765,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -875,11 +782,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -891,10 +798,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -908,7 +811,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentResource] @@ -933,18 +835,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -955,14 +856,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -972,11 +873,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -988,10 +889,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1011,23 +908,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1037,11 +933,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1058,14 +950,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1096,7 +980,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1105,17 +989,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1136,23 +1016,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1162,11 +1041,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1183,14 +1058,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1221,7 +1088,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1230,17 +1097,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1261,23 +1124,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1287,11 +1149,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1308,14 +1166,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1346,7 +1196,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1355,17 +1205,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_remote_debugging_initial( self, @@ -1373,7 +1219,7 @@ async def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -1404,7 +1250,7 @@ async def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1414,16 +1260,15 @@ async def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1443,10 +1288,6 @@ async def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload async def begin_enable_remote_debugging( self, @@ -1476,14 +1317,6 @@ async def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1498,7 +1331,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1515,18 +1348,10 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1541,7 +1366,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> AsyncLROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -1556,20 +1381,9 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -1606,7 +1420,7 @@ async def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1616,17 +1430,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1647,23 +1459,22 @@ async def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1683,10 +1494,6 @@ async def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace_async async def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1702,14 +1509,6 @@ async def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -1743,7 +1542,7 @@ async def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1753,17 +1552,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def get_remote_debugging_config( @@ -1780,7 +1577,6 @@ async def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -1801,23 +1597,22 @@ async def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1829,13 +1624,9 @@ async def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1852,7 +1643,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1873,23 +1663,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1903,13 +1692,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1917,7 +1702,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1945,7 +1730,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1955,16 +1740,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1974,11 +1758,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -2009,14 +1789,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2029,7 +1801,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2046,18 +1818,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2070,7 +1834,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -2085,20 +1849,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2132,7 +1885,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2141,17 +1894,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2159,7 +1908,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2187,7 +1936,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2197,16 +1946,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2216,11 +1964,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -2251,14 +1995,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2271,7 +2007,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2288,18 +2024,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2312,7 +2040,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -2327,20 +2055,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2374,7 +2091,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2383,17 +2100,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2401,7 +2114,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2429,7 +2142,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2439,16 +2152,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2458,11 +2170,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2493,14 +2201,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2513,7 +2213,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2530,18 +2230,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2554,7 +2246,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2569,20 +2261,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2616,7 +2297,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2625,14 +2306,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_gateway_custom_domains_operations.py index a074e70f4b2..2532705ba30 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_gateway_route_configs_operations.py index a59980c0143..418144d31b4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -264,7 +245,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -283,18 +264,10 @@ async def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -309,7 +282,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -325,20 +298,9 @@ async def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -375,7 +337,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -385,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -416,23 +376,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +401,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +418,6 @@ async def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -501,7 +448,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -510,17 +457,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -535,7 +478,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -561,18 +503,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -583,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -600,11 +541,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -615,7 +556,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_gateways_operations.py index b8e311fb85a..d993bc07772 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -365,17 +327,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -396,22 +356,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -440,14 +395,6 @@ async def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -477,7 +424,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -486,17 +433,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -509,7 +452,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayResource] @@ -534,17 +476,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -555,14 +496,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -572,11 +513,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +529,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload async def validate_domain( self, @@ -618,7 +555,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -630,7 +566,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -645,11 +581,10 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -661,7 +596,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -674,13 +609,9 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -710,7 +641,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -719,16 +650,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,10 +670,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_monitoring_settings_operations.py index 469e8bea469..82e7ac35a31 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -346,23 +308,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -390,7 +350,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -398,16 +358,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,10 +386,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -454,14 +409,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -474,7 +421,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -487,18 +434,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -511,7 +450,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -522,20 +461,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +498,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -580,14 +508,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_operations.py index cb0ff8cf9bb..050053e8aa9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_runtime_versions_operations.py index 2712478ca08..172eec6213e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_service_registries_operations.py index 822c7f7bff2..8eb2faffad2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,13 +120,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -149,22 +143,21 @@ async def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -184,10 +177,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -201,14 +190,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -241,7 +222,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -251,17 +232,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -282,22 +261,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,11 +285,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -326,14 +300,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -363,7 +329,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -372,17 +338,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -395,7 +357,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -421,17 +382,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -442,14 +402,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -459,11 +419,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -474,7 +434,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_services_operations.py index f8bf4656d5f..6dc92705295 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -101,21 +100,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,16 +125,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -163,7 +161,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -171,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -229,14 +222,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -249,7 +234,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -262,18 +247,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -283,7 +260,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -293,19 +274,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -340,7 +310,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -350,17 +320,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -381,21 +349,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -405,11 +372,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -420,14 +383,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -456,7 +411,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -465,20 +420,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -505,7 +460,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -513,16 +468,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -542,10 +496,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -568,14 +518,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -588,7 +530,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -601,18 +543,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -622,7 +556,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -631,20 +569,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -679,7 +606,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -689,17 +616,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -710,7 +635,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -731,21 +655,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -757,13 +680,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -788,7 +707,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -799,7 +717,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -812,11 +730,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -827,7 +744,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -838,13 +755,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_09_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -874,7 +787,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -882,16 +795,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -903,13 +815,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -922,7 +830,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -943,21 +850,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -967,11 +873,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -984,7 +886,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1005,21 +906,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1031,13 +931,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1058,35 +954,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1097,14 +988,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1133,7 +1016,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1142,17 +1025,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1173,35 +1052,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1212,14 +1086,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1248,7 +1114,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1257,17 +1123,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -1288,7 +1150,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1296,18 +1157,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1315,20 +1180,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_09_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1358,23 +1222,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1386,19 +1249,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceResource] @@ -1423,15 +1281,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1442,14 +1299,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1459,11 +1316,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1475,8 +1332,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1484,7 +1339,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceResource] @@ -1509,16 +1363,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1529,14 +1382,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1546,11 +1399,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1561,7 +1414,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_skus_operations.py index 033b20ebcc5..0bb79d4c38b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_storages_operations.py index 07521700c05..df6690ad275 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -270,18 +251,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -295,7 +268,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -308,20 +281,9 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -357,7 +319,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -367,17 +329,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -398,22 +358,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -423,11 +382,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -442,14 +397,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -479,7 +426,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -488,17 +435,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -511,7 +454,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.StorageResource] @@ -536,17 +478,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -557,14 +498,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -574,11 +515,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,7 +530,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/models/_models_py3.py index dcaee13efeb..eb400523342 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/models/_models_py3.py @@ -118,24 +118,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2022_09_01_preview.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class ApiPortalCustomDomainResource(ProxyResource): """Custom domain of the API portal. @@ -765,7 +747,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -818,7 +800,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -1660,7 +1642,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -1698,7 +1680,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2067,7 +2049,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -2345,7 +2327,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -2644,7 +2626,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -2681,7 +2663,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -2993,7 +2975,7 @@ def __init__( self.git_property = git_property -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -3048,7 +3030,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3180,7 +3162,7 @@ def __init__( class CustomContainerUserSourceInfo(UserSourceInfo): """Custom container user source info. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -3338,7 +3320,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -3390,7 +3372,7 @@ def __init__(self, *, is_valid: Optional[bool] = None, message: Optional[str] = class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -3837,7 +3819,7 @@ class ProbeAction(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ExecAction, HTTPGetAction, TCPSocketAction - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -3865,7 +3847,7 @@ def __init__(self, **kwargs: Any) -> None: class ExecAction(ProbeAction): """ExecAction describes a "run in container" action. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -4689,7 +4671,7 @@ def __init__( class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -4791,7 +4773,7 @@ def __init__( class HTTPGetAction(ProbeAction): """HTTPGetAction describes an action based on HTTP Get requests. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -4987,7 +4969,7 @@ class UploadedUserSourceInfo(UserSourceInfo): You probably want to use the sub-classes and not this class directly. Known sub-classes are: JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -5030,7 +5012,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -5086,7 +5068,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -5180,7 +5162,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -5214,7 +5196,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -5668,7 +5650,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -5701,7 +5683,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -6042,7 +6024,7 @@ class Probe(_serialization.Model): """Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive traffic. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar probe_action: The action of the probe. :vartype probe_action: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ProbeAction @@ -6124,7 +6106,7 @@ def __init__( class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2022_09_01_preview.models.TestKeyType @@ -7008,7 +6990,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -7062,7 +7044,7 @@ def __init__( class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7203,7 +7185,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2022_09_01_preview.models.StorageType @@ -7228,7 +7210,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2022_09_01_preview.models.StorageType @@ -7657,7 +7639,7 @@ def __init__( class TCPSocketAction(ProbeAction): """TCPSocketAction describes an action based on opening a socket. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_api_portal_custom_domains_operations.py index 328dc5934bd..cfacb7e7c57 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_api_portals_operations.py index 2530b1d43e9..67e44a87cb4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -465,20 +438,9 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -524,17 +486,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -555,22 +515,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,11 +539,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -599,14 +554,6 @@ def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -636,7 +583,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,17 +592,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: @@ -666,7 +609,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.ApiPortalResource] @@ -691,17 +633,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -712,14 +653,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -729,11 +670,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -745,10 +686,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload def validate_domain( self, @@ -775,7 +712,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -787,7 +723,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -802,11 +738,10 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -818,7 +753,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -831,13 +766,9 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -867,7 +798,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -876,16 +807,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +827,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_apps_operations.py index 627208f3d7b..d6410223dd9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -373,23 +372,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -401,20 +399,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -442,7 +436,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -451,16 +445,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -483,10 +476,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -512,14 +501,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -533,7 +514,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -548,18 +529,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -573,7 +546,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -586,19 +559,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -634,7 +596,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -644,17 +606,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -675,22 +635,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -700,11 +659,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -719,14 +674,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -756,7 +703,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -765,24 +712,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -810,7 +753,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -819,16 +762,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -848,10 +790,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -877,14 +815,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -898,7 +828,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -913,18 +843,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -938,7 +860,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -950,20 +872,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -999,7 +910,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1009,17 +920,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1030,7 +939,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.AppResource] @@ -1055,17 +963,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1076,14 +983,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1093,11 +1000,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1109,10 +1016,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1126,7 +1029,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1147,22 +1049,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,20 +1075,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1215,7 +1112,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1224,16 +1121,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1253,10 +1149,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1283,14 +1175,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1304,7 +1188,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1319,18 +1203,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1344,7 +1220,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1357,20 +1233,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1406,7 +1271,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1416,17 +1281,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1454,7 +1317,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1466,7 +1328,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1481,11 +1343,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1497,7 +1358,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1510,13 +1371,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1546,7 +1403,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1555,16 +1412,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,10 +1432,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_bindings_operations.py index 03a8c379fc8..e62df92e84d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -871,20 +793,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.BindingResource] @@ -981,18 +889,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +910,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1020,11 +927,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1035,7 +942,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_build_service_agent_pool_operations.py index 3eef1b5eb9c..fc73847826b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -209,18 +208,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -231,14 +229,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -248,11 +246,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -264,10 +262,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -283,7 +277,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -304,23 +297,22 @@ def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -332,13 +324,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -346,7 +334,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -374,7 +362,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -384,16 +372,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -413,10 +400,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -446,14 +429,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -468,7 +443,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -485,18 +460,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -511,7 +478,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -526,20 +493,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -576,7 +532,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +542,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_build_service_builder_operations.py index f0793388165..07d7847d55a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -261,7 +261,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -282,23 +281,22 @@ def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -310,13 +308,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -324,7 +318,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -352,7 +346,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -362,16 +356,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -391,10 +384,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -423,14 +412,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -445,7 +426,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -462,18 +443,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -488,7 +461,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -503,20 +476,9 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -553,7 +515,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -563,17 +525,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -594,23 +554,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -620,11 +579,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -641,14 +596,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -679,7 +626,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -688,17 +635,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -713,7 +656,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.BuilderResource] @@ -738,18 +680,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -760,14 +701,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -777,11 +718,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,10 +734,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -812,7 +749,6 @@ def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -833,23 +769,22 @@ def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -861,10 +796,6 @@ def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_build_service_operations.py index 40f88693995..4ca655508cc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -532,7 +532,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildService] @@ -557,17 +556,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -578,14 +576,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -595,11 +593,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -611,10 +609,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -628,7 +622,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -649,22 +642,21 @@ def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -676,13 +668,9 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -697,7 +685,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -721,18 +708,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -743,14 +729,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -760,11 +746,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -776,10 +762,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -795,7 +777,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -816,23 +797,22 @@ def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -844,13 +824,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -880,7 +856,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -893,7 +868,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -910,11 +885,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -927,7 +901,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -941,13 +915,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2022_09_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2022_09_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -977,7 +947,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -987,16 +957,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1016,10 +985,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1035,7 +1000,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildResult] @@ -1060,19 +1024,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1083,14 +1046,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1100,11 +1063,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1116,10 +1079,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1143,7 +1102,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1164,7 +1122,7 @@ def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1172,16 +1130,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1193,13 +1150,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1224,7 +1177,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1245,7 +1197,7 @@ def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1253,16 +1205,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1274,13 +1225,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1295,7 +1242,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1316,22 +1262,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1343,13 +1288,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1364,7 +1305,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1385,22 +1325,21 @@ def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1412,13 +1351,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1435,7 +1370,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1456,23 +1390,22 @@ def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1484,13 +1417,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1505,7 +1434,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1526,22 +1454,21 @@ def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1553,13 +1480,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -1576,7 +1499,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1597,23 +1519,22 @@ def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1625,10 +1546,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_buildpack_binding_operations.py index f6ebf009c9b..ed02f12cfca 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -243,7 +243,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -264,7 +263,7 @@ def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -272,16 +271,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -308,7 +302,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -336,7 +330,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -347,16 +341,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -376,10 +369,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -413,14 +402,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -436,7 +417,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -456,18 +437,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -483,7 +456,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -500,20 +473,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -551,7 +513,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -561,17 +523,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -598,7 +558,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -606,16 +566,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -625,11 +584,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -654,14 +609,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -693,7 +640,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -702,17 +649,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -729,7 +672,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -755,19 +697,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -778,14 +719,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -795,11 +736,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -810,7 +751,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_certificates_operations.py index 41feb1e7135..9e9e0325f45 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -493,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -524,22 +484,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -549,11 +508,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -568,14 +523,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -605,7 +552,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -614,17 +561,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -637,7 +580,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.CertificateResource] @@ -662,17 +604,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -683,14 +624,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -700,11 +641,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -715,7 +656,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_config_servers_operations.py index ce4419085d8..c47669f1189 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -474,23 +436,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -518,7 +478,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -526,16 +486,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,10 +514,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -582,14 +537,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -602,7 +549,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -615,18 +562,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -639,7 +578,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -650,20 +589,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -698,7 +626,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -708,23 +636,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -752,7 +678,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -760,16 +686,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -789,10 +714,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -816,14 +737,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -836,7 +749,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -849,18 +762,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -873,7 +778,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -884,20 +789,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -932,7 +826,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -944,14 +838,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_configuration_services_operations.py index fc1206d0801..a91c19f306d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -393,14 +382,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -414,7 +395,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -430,18 +411,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -469,20 +442,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -559,22 +519,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,11 +543,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -603,14 +558,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -640,7 +587,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -649,17 +596,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -672,7 +615,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -698,17 +640,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -719,14 +660,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -736,11 +677,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -752,16 +693,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -789,7 +726,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -798,16 +735,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -827,10 +763,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -856,14 +788,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -877,7 +801,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -892,18 +816,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -917,7 +833,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -930,20 +846,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -979,7 +884,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -991,14 +896,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_custom_domains_operations.py index c0a24ea9633..5a1dbc6b09c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -871,20 +793,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -982,18 +890,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1004,14 +911,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1021,11 +928,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,7 +943,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_deployments_operations.py index 14f6002d03b..eaa347785ce 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -468,7 +468,7 @@ def build_disable_remote_debugging_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_remote_debugging_config_request( +def build_get_remote_debugging_config_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, app_name: str, @@ -702,7 +702,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -723,23 +722,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,13 +749,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -765,7 +759,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -793,7 +787,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -803,16 +797,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -835,10 +828,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -868,14 +857,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -890,7 +871,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -907,18 +888,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -933,7 +906,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -948,20 +921,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -998,7 +960,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1008,17 +970,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1039,23 +999,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1065,11 +1024,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -1086,14 +1041,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1124,7 +1071,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1133,17 +1080,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1151,7 +1094,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1179,7 +1122,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1189,16 +1132,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1218,10 +1160,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1251,14 +1189,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1273,7 +1203,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1290,18 +1220,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1316,7 +1238,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1331,20 +1253,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1381,7 +1292,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1391,17 +1302,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1423,7 +1332,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentResource] @@ -1448,19 +1356,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1471,14 +1378,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1488,11 +1395,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1504,10 +1411,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1521,7 +1424,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.DeploymentResource] @@ -1546,18 +1448,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1568,14 +1469,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1585,11 +1486,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1601,10 +1502,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1624,23 +1521,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1650,11 +1546,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1671,14 +1563,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1709,7 +1593,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1718,17 +1602,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1749,23 +1629,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1775,11 +1654,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1796,14 +1671,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1834,7 +1701,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1843,17 +1710,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1874,23 +1737,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1900,11 +1762,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1921,14 +1779,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1959,7 +1809,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1968,17 +1818,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_remote_debugging_initial( self, @@ -1986,7 +1832,7 @@ def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -2017,7 +1863,7 @@ def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2027,16 +1873,15 @@ def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2056,10 +1901,6 @@ def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload def begin_enable_remote_debugging( self, @@ -2089,14 +1930,6 @@ def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2111,7 +1944,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2128,18 +1961,10 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2154,7 +1979,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> LROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -2169,20 +1994,9 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of LROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -2219,7 +2033,7 @@ def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2229,17 +2043,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2260,23 +2072,22 @@ def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2296,10 +2107,6 @@ def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2315,14 +2122,6 @@ def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -2356,7 +2155,7 @@ def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2366,17 +2165,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def get_remote_debugging_config( @@ -2393,7 +2190,6 @@ def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -2414,23 +2210,22 @@ def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2442,13 +2237,9 @@ def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace def get_log_file_url( @@ -2465,7 +2256,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -2486,23 +2276,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2516,13 +2305,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2530,7 +2315,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2558,7 +2343,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2568,16 +2353,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2587,11 +2371,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2622,14 +2402,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2642,7 +2414,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2659,18 +2431,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2683,7 +2447,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2698,20 +2462,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2745,7 +2498,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2754,17 +2507,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2772,7 +2521,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2800,7 +2549,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2810,16 +2559,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2829,11 +2577,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2864,14 +2608,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2884,7 +2620,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2901,18 +2637,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2925,7 +2653,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2940,20 +2668,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2987,7 +2704,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2996,17 +2713,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -3014,7 +2727,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -3042,7 +2755,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -3052,16 +2765,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -3071,11 +2783,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -3106,14 +2814,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -3126,7 +2826,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -3143,18 +2843,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -3167,7 +2859,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -3182,20 +2874,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -3229,7 +2910,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3238,14 +2919,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_gateway_custom_domains_operations.py index 120598977ad..7480236b39e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_gateway_route_configs_operations.py index d78703e1421..1b8f4ef3955 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload def begin_create_or_update( self, @@ -388,14 +377,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -410,7 +391,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -429,18 +410,10 @@ def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -471,20 +444,9 @@ def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -521,7 +483,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -531,17 +493,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -562,23 +522,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,11 +547,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -609,14 +564,6 @@ def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -647,7 +594,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -656,17 +603,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -681,7 +624,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -707,18 +649,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -729,14 +670,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -746,11 +687,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -761,7 +702,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_gateways_operations.py index 24222eeb358..d06e26a51b8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -465,20 +438,9 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -524,17 +486,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -555,22 +515,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,11 +539,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -599,14 +554,6 @@ def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -636,7 +583,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,17 +592,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: @@ -666,7 +609,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.GatewayResource] @@ -691,17 +633,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -712,14 +653,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -729,11 +670,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -745,10 +686,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload def validate_domain( self, @@ -775,7 +712,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -787,7 +723,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -802,11 +738,10 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -818,7 +753,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -831,13 +766,9 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -867,7 +798,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -876,16 +807,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +827,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_monitoring_settings_operations.py index 0f34523cd0f..01087c59537 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -440,23 +402,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -484,7 +444,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -492,16 +452,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -521,10 +480,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -548,14 +503,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -568,7 +515,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +528,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -605,7 +544,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -616,20 +555,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_09_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -664,7 +592,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -674,14 +602,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_operations.py index cfb3d396ac7..d53392d789f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_runtime_versions_operations.py index 3aa79da03f4..bb3193897bb 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_service_registries_operations.py index 546311688c6..7f4b990c7b9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -217,22 +216,21 @@ def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,13 +242,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -271,22 +265,21 @@ def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +299,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -323,14 +312,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -373,17 +354,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -404,22 +383,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,11 +407,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -448,14 +422,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -485,7 +451,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -494,17 +460,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -517,7 +479,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -543,17 +504,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -581,11 +541,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +556,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_services_operations.py index 46a46ce28e9..742634179ff 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -466,7 +466,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -487,21 +486,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -513,16 +511,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -549,7 +547,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -557,16 +555,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,10 +586,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -615,14 +608,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -635,7 +620,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -648,18 +633,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -669,7 +646,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -679,19 +660,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -726,7 +696,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -736,17 +706,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -767,21 +735,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -791,11 +758,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -806,14 +769,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -842,7 +797,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -851,20 +806,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -891,7 +846,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -899,16 +854,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -928,10 +882,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -954,14 +904,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -974,7 +916,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -987,18 +929,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1008,7 +942,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1017,20 +955,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1065,7 +992,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1075,17 +1002,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1096,7 +1021,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1117,21 +1041,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1143,13 +1066,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1174,7 +1093,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1185,7 +1103,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1198,11 +1116,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1213,7 +1130,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1224,13 +1141,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_09_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1260,7 +1173,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1268,16 +1181,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1289,13 +1201,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1308,7 +1216,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1329,21 +1236,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1353,11 +1259,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1368,7 +1270,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1389,21 +1290,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1415,13 +1315,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1442,35 +1338,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1481,14 +1372,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1517,7 +1400,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1526,17 +1409,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1557,35 +1436,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1596,14 +1470,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1632,7 +1498,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1641,17 +1507,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -1672,7 +1534,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1680,18 +1541,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1699,20 +1564,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2022_09_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_09_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1742,23 +1606,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1770,19 +1633,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceResource] @@ -1807,15 +1665,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1826,14 +1683,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1843,11 +1700,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1859,8 +1716,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1868,7 +1723,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.ServiceResource] @@ -1893,16 +1747,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1913,14 +1766,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1930,11 +1783,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1945,7 +1798,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_skus_operations.py index e123f7904ce..844005c295f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_storages_operations.py index dab5c98b7f3..748f7262a44 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_09_01_preview/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_09_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -359,14 +348,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -380,7 +361,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -395,18 +376,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -420,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -433,20 +406,9 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2022_09_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -482,7 +444,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -492,17 +454,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -523,22 +483,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +507,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -567,14 +522,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -604,7 +551,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -613,17 +560,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -634,7 +577,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_09_01_preview.models.StorageResource] @@ -659,17 +601,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -680,14 +621,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -697,11 +638,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -712,7 +653,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/_app_platform_management_client.py index ee922e2b935..5c9a11a2271 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -155,7 +157,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -242,7 +262,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2022-11-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -262,7 +282,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/_configuration.py index 6aa00cd261a..beea06a1bf1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2022-11-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/_app_platform_management_client.py index 8b24d31eeb8..b541cffefc0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -155,7 +157,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -242,7 +262,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2022-11-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -262,7 +284,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/_configuration.py index f0a29cc7cf5..013e95edd9b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2022-11-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_api_portal_custom_domains_operations.py index 889e5cb1666..fbd1cdcdd4d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_api_portals_operations.py index a3546cb1d35..62571b1f512 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -365,17 +327,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -396,22 +356,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -440,14 +395,6 @@ async def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -477,7 +424,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -486,17 +433,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -509,7 +452,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.ApiPortalResource] @@ -534,17 +476,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -555,14 +496,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -572,11 +513,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +529,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload async def validate_domain( self, @@ -618,7 +555,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -630,7 +566,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -645,11 +581,10 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -661,7 +596,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -674,13 +609,9 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -710,7 +641,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -719,16 +650,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,10 +670,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_application_accelerators_operations.py index 90b2c2ff297..c7a94356e6e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -328,14 +311,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -349,7 +324,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -365,18 +340,10 @@ async def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -390,7 +357,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -403,20 +370,9 @@ async def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -452,7 +408,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -462,17 +418,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -493,22 +447,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -518,11 +471,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -537,14 +486,6 @@ async def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -574,7 +515,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -583,14 +524,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_application_live_views_operations.py index 1d49909c5ea..7a2d58f2bf9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -581,14 +522,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_apps_operations.py index 82904e72a7d..e7fc2d3af04 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,20 +133,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -176,7 +170,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -185,16 +179,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -217,10 +210,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -246,14 +235,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -267,7 +248,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -320,19 +293,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -368,7 +330,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -378,17 +340,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -409,22 +369,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,11 +393,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -453,14 +408,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -490,7 +437,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -499,24 +446,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -544,7 +487,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -553,16 +496,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,10 +524,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -611,14 +549,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -632,7 +562,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -647,18 +577,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -672,7 +594,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -684,20 +606,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -733,7 +644,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -743,17 +654,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -764,7 +673,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.AppResource] @@ -789,17 +697,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -810,14 +717,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -827,11 +734,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -843,10 +750,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -860,7 +763,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -881,22 +783,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -908,20 +809,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -949,7 +846,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -958,16 +855,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -987,10 +883,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -1017,14 +909,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1038,7 +922,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1053,18 +937,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1078,7 +954,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1091,20 +967,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1140,7 +1005,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1150,17 +1015,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1188,7 +1051,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1200,7 +1062,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1215,11 +1077,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1231,7 +1092,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1244,13 +1105,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1280,7 +1137,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1289,16 +1146,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1310,10 +1166,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_bindings_operations.py index 022126b8abe..30839975d19 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -705,20 +627,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.BindingResource] @@ -815,18 +723,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -837,14 +744,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -854,11 +761,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -869,7 +776,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_build_service_agent_pool_operations.py index b28dcdfa710..ef670e99aeb 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -174,7 +168,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -195,23 +188,22 @@ async def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -223,13 +215,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -237,7 +225,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -265,7 +253,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -275,16 +263,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -304,10 +291,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -337,14 +320,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -359,7 +334,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +351,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -402,7 +369,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -417,20 +384,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -467,7 +423,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -477,14 +433,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_build_service_builder_operations.py index 51c404f51d2..5659a0d2881 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,10 +201,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -240,14 +229,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -262,7 +243,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -279,18 +260,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -305,7 +278,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -320,20 +293,9 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -370,7 +332,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -380,17 +342,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -411,23 +371,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +396,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -458,14 +413,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -496,7 +443,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -505,17 +452,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -530,7 +473,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.BuilderResource] @@ -555,18 +497,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -577,14 +518,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -594,11 +535,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -610,10 +551,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace_async async def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -629,7 +566,6 @@ async def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -650,23 +586,22 @@ async def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -678,10 +613,6 @@ async def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_build_service_operations.py index 4e9052d6d82..4341ba32afe 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildService] @@ -105,17 +104,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -126,14 +124,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -143,11 +141,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -159,10 +157,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -176,7 +170,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -197,22 +190,21 @@ async def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -224,13 +216,9 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -245,7 +233,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.Build] @@ -270,18 +257,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -292,14 +278,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -309,11 +295,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -325,10 +311,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -344,7 +326,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -365,23 +346,22 @@ async def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -393,13 +373,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -429,7 +405,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -442,7 +417,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -459,11 +434,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -476,7 +450,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -490,13 +464,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2022_11_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2022_11_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -526,7 +496,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -536,16 +506,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -565,10 +534,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -584,7 +549,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildResult] @@ -609,19 +573,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -632,14 +595,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -649,11 +612,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -665,10 +628,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -692,7 +651,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -713,7 +671,7 @@ async def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -721,16 +679,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -742,13 +699,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -773,7 +726,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -794,7 +746,7 @@ async def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -802,16 +754,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -823,13 +774,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -844,7 +791,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -865,22 +811,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -892,13 +837,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -913,7 +854,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -934,22 +874,21 @@ async def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -961,13 +900,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -984,7 +919,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1005,23 +939,22 @@ async def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1033,13 +966,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1054,7 +983,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1075,22 +1003,21 @@ async def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1102,13 +1029,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1125,7 +1048,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1146,23 +1068,22 @@ async def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,10 +1095,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_buildpack_binding_operations.py index 8d9fd51ddee..709378fbaaf 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -85,7 +85,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -106,7 +105,7 @@ async def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -114,16 +113,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,13 +133,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -150,7 +144,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -178,7 +172,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -189,16 +183,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,10 +211,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -255,14 +244,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -278,7 +259,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -298,18 +279,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -325,7 +298,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -342,20 +315,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -393,7 +355,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -403,17 +365,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -440,7 +400,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -448,16 +408,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -467,11 +426,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -496,14 +451,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -535,7 +482,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -544,17 +491,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -571,7 +514,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -597,19 +539,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -620,14 +561,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -637,11 +578,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -652,7 +593,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_certificates_operations.py index 76b1cddf17f..96d3a2d4389 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,17 +330,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -399,22 +359,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,11 +383,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -443,14 +398,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -489,17 +436,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -512,7 +455,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.CertificateResource] @@ -537,17 +479,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -558,14 +499,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -575,11 +516,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -590,7 +531,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_config_servers_operations.py index 91aa64a5432..1e2ffb99868 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -345,23 +307,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -389,7 +349,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -397,16 +357,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,10 +385,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -453,14 +408,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -473,7 +420,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -486,18 +433,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -510,7 +449,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -521,20 +460,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -569,7 +497,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -579,23 +507,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -623,7 +549,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -631,16 +557,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -660,10 +585,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -687,14 +608,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -707,7 +620,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -720,18 +633,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -744,7 +649,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -755,20 +660,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -803,7 +697,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -815,14 +709,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_configuration_services_operations.py index c07e3acc4e0..396cce78370 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -310,20 +283,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -359,7 +321,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -369,17 +331,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -400,22 +360,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -425,11 +384,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -444,14 +399,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -481,7 +428,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -490,17 +437,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -513,7 +456,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -539,17 +481,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -560,14 +501,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -577,11 +518,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,16 +534,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -630,7 +567,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -639,16 +576,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -668,10 +604,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -697,14 +629,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -718,7 +642,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -733,18 +657,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -758,7 +674,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -771,20 +687,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -820,7 +725,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -832,14 +737,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_custom_domains_operations.py index dd69071e394..b2761e742ad 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -705,20 +627,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -816,18 +724,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -838,14 +745,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -855,11 +762,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -870,7 +777,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_customized_accelerators_operations.py index 20f159cf8b9..a6c24326b90 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -102,18 +101,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -124,14 +122,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -141,11 +139,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,10 +155,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,23 +195,22 @@ async def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -230,13 +222,9 @@ async def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -244,7 +232,7 @@ async def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -272,7 +260,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -282,16 +270,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -311,10 +298,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -345,14 +328,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -367,7 +342,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -385,18 +360,10 @@ async def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -411,7 +378,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -426,20 +393,9 @@ async def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -476,7 +432,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -486,17 +442,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -522,23 +476,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +501,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -574,14 +523,6 @@ async def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -612,7 +553,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -621,17 +562,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def validate( @@ -662,7 +599,6 @@ async def validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -676,7 +612,7 @@ async def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -693,11 +629,10 @@ async def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -711,7 +646,7 @@ async def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -726,13 +661,9 @@ async def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -763,7 +694,7 @@ async def validate( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -773,16 +704,15 @@ async def validate( content_type=content_type, json=_json, content=_content, - template_url=self.validate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -796,10 +726,6 @@ async def validate( deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_deployments_operations.py index ae3b9c836e2..e0b15c67111 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -89,7 +89,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -110,23 +109,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -138,13 +136,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -152,7 +146,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -180,7 +174,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -190,16 +184,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -222,10 +215,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -255,14 +244,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -277,7 +258,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -294,18 +275,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -320,7 +293,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -335,20 +308,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -385,7 +347,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -395,17 +357,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -426,23 +386,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -452,11 +411,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -473,14 +428,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -511,7 +458,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -520,17 +467,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -538,7 +481,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -566,7 +509,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -576,16 +519,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -605,10 +547,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -638,14 +576,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -660,7 +590,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -677,18 +607,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -703,7 +625,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -718,20 +640,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -768,7 +679,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -778,17 +689,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -810,7 +719,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentResource] @@ -835,19 +743,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -858,14 +765,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -875,11 +782,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -891,10 +798,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -908,7 +811,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentResource] @@ -933,18 +835,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -955,14 +856,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -972,11 +873,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -988,10 +889,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1011,23 +908,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1037,11 +933,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1058,14 +950,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1096,7 +980,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1105,17 +989,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1136,23 +1016,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1162,11 +1041,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1183,14 +1058,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1221,7 +1088,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1230,17 +1097,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1261,23 +1124,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1287,11 +1149,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1308,14 +1166,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1346,7 +1196,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1355,17 +1205,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_remote_debugging_initial( self, @@ -1373,7 +1219,7 @@ async def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -1404,7 +1250,7 @@ async def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1414,16 +1260,15 @@ async def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1443,10 +1288,6 @@ async def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload async def begin_enable_remote_debugging( self, @@ -1476,14 +1317,6 @@ async def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1498,7 +1331,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1515,18 +1348,10 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1541,7 +1366,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> AsyncLROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -1556,20 +1381,9 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -1606,7 +1420,7 @@ async def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1616,17 +1430,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1647,23 +1459,22 @@ async def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1683,10 +1494,6 @@ async def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace_async async def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1702,14 +1509,6 @@ async def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -1743,7 +1542,7 @@ async def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1753,17 +1552,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def get_remote_debugging_config( @@ -1780,7 +1577,6 @@ async def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -1801,23 +1597,22 @@ async def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1829,13 +1624,9 @@ async def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1852,7 +1643,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1873,23 +1663,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1903,13 +1692,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1917,7 +1702,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1945,7 +1730,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1955,16 +1740,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1974,11 +1758,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -2009,14 +1789,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2029,7 +1801,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2046,18 +1818,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2070,7 +1834,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -2085,20 +1849,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2132,7 +1885,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2141,17 +1894,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2159,7 +1908,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2187,7 +1936,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2197,16 +1946,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2216,11 +1964,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -2251,14 +1995,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2271,7 +2007,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2288,18 +2024,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2312,7 +2040,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -2327,20 +2055,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2374,7 +2091,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2383,17 +2100,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2401,7 +2114,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2429,7 +2142,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2439,16 +2152,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2458,11 +2170,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2493,14 +2201,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2513,7 +2213,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2530,18 +2230,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2554,7 +2246,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2569,20 +2261,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2616,7 +2297,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2625,14 +2306,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_dev_tool_portals_operations.py index 24f383327dc..1e9fc16064a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -581,14 +522,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_gateway_custom_domains_operations.py index 7f2ec0a6a86..33e5c53ccd0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_gateway_route_configs_operations.py index c10578ae498..232264c0957 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -264,7 +245,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -283,18 +264,10 @@ async def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -309,7 +282,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -325,20 +298,9 @@ async def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -375,7 +337,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -385,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -416,23 +376,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +401,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +418,6 @@ async def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -501,7 +448,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -510,17 +457,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -535,7 +478,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -561,18 +503,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -583,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -600,11 +541,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -615,7 +556,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_gateways_operations.py index b9350590afe..adf64c6bb21 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,22 +97,21 @@ async def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,20 +123,16 @@ async def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -166,7 +160,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -204,10 +197,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload async def begin_create_or_update( self, @@ -233,14 +222,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -254,7 +235,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -269,18 +250,10 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -294,7 +267,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -307,20 +280,9 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -356,7 +318,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -366,17 +328,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -397,22 +357,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,11 +381,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -441,14 +396,6 @@ async def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -478,7 +425,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -487,17 +434,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_env_secrets( @@ -512,7 +455,6 @@ async def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -533,22 +475,21 @@ async def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -560,13 +501,9 @@ async def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore @distributed_trace def list( @@ -579,7 +516,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayResource] @@ -604,17 +540,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -625,14 +560,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -642,11 +577,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -658,10 +593,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload async def validate_domain( self, @@ -688,7 +619,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -700,7 +630,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -715,11 +645,10 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -731,7 +660,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -744,13 +673,9 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -780,7 +705,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -789,16 +714,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -810,10 +734,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_monitoring_settings_operations.py index 1d70b88ca5c..405c30823ee 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -346,23 +308,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -390,7 +350,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -398,16 +358,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,10 +386,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -454,14 +409,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -474,7 +421,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -487,18 +434,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -511,7 +450,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -522,20 +461,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +498,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -580,14 +508,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_operations.py index 3fc9d5340cb..f3d7e3759b2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_predefined_accelerators_operations.py index be0ad59da9e..bd50258f9c5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace_async async def get( self, @@ -179,7 +173,6 @@ async def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -200,23 +193,22 @@ async def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,13 +220,9 @@ async def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore async def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -260,23 +248,22 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -286,11 +273,7 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_disable( @@ -312,14 +295,6 @@ async def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -350,7 +325,7 @@ async def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -359,17 +334,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -395,23 +366,22 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +391,7 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_enable( @@ -447,14 +413,6 @@ async def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -485,7 +443,7 @@ async def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -494,14 +452,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_runtime_versions_operations.py index c8b6cb6f3a5..0057cb46839 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_service_registries_operations.py index b4db20108b5..0fd429ca6e0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,13 +120,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -149,22 +143,21 @@ async def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -184,10 +177,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -201,14 +190,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -241,7 +222,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -251,17 +232,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -282,22 +261,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,11 +285,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -326,14 +300,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -363,7 +329,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -372,17 +338,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -395,7 +357,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -421,17 +382,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -442,14 +402,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -459,11 +419,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -474,7 +434,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_services_operations.py index 29c8ed9128f..1485a71013b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -101,21 +100,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,16 +125,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -163,7 +161,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -171,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -229,14 +222,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -249,7 +234,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -262,18 +247,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -283,7 +260,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -293,19 +274,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -340,7 +310,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -350,17 +320,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -381,21 +349,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -405,11 +372,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -420,14 +383,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -456,7 +411,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -465,20 +420,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -505,7 +460,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -513,16 +468,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -542,10 +496,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -568,14 +518,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -588,7 +530,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -601,18 +543,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -622,7 +556,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -631,20 +569,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -679,7 +606,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -689,17 +616,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -710,7 +635,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -731,21 +655,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -757,13 +680,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -788,7 +707,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -799,7 +717,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -812,11 +730,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -827,7 +744,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -838,13 +755,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_11_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -874,7 +787,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -882,16 +795,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -903,13 +815,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -922,7 +830,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -943,21 +850,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -967,11 +873,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -984,7 +886,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1005,21 +906,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1031,13 +931,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1058,35 +954,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1097,14 +988,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1133,7 +1016,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1142,17 +1025,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1173,35 +1052,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1212,14 +1086,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1248,7 +1114,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1257,17 +1123,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -1288,7 +1150,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1296,18 +1157,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1315,20 +1180,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_11_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1358,23 +1222,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1386,19 +1249,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceResource] @@ -1423,15 +1281,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1442,14 +1299,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1459,11 +1316,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1475,8 +1332,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1484,7 +1339,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceResource] @@ -1509,16 +1363,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1529,14 +1382,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1546,11 +1399,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1561,7 +1414,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_skus_operations.py index 3d28a77d44f..e3123140443 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_storages_operations.py index 60787e802f2..4f51c7590d0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -270,18 +251,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -295,7 +268,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -308,20 +281,9 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -357,7 +319,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -367,17 +329,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -398,22 +358,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -423,11 +382,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -442,14 +397,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -479,7 +426,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -488,17 +435,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -511,7 +454,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.StorageResource] @@ -536,17 +478,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -557,14 +498,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -574,11 +515,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,7 +530,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/models/_models_py3.py index c48ace5815a..26dee73aff8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/models/_models_py3.py @@ -30,7 +30,7 @@ class AcceleratorAuthSetting(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AcceleratorBasicAuthSetting, AcceleratorPublicSetting, AcceleratorSshSetting - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -61,7 +61,7 @@ def __init__(self, **kwargs: Any) -> None: class AcceleratorBasicAuthSetting(AcceleratorAuthSetting): """Auth setting for basic auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -98,7 +98,7 @@ def __init__(self, *, username: str, password: Optional[str] = None, **kwargs: A class AcceleratorGitRepository(_serialization.Model): """AcceleratorGitRepository. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: Git repository URL for the accelerator. Required. :vartype url: str @@ -167,7 +167,7 @@ def __init__( class AcceleratorPublicSetting(AcceleratorAuthSetting): """Auth setting for public url. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -190,7 +190,7 @@ def __init__(self, **kwargs: Any) -> None: class AcceleratorSshSetting(AcceleratorAuthSetting): """Auth setting for SSH auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -330,24 +330,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2022_11_01_preview.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class ApiPortalCustomDomainResource(ProxyResource): """Custom domain of the API portal. @@ -1414,7 +1396,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -1467,7 +1449,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -2322,7 +2304,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2360,7 +2342,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2739,7 +2721,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3017,7 +2999,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -3316,7 +3298,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -3353,7 +3335,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -3665,7 +3647,7 @@ def __init__( self.git_property = git_property -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -3720,7 +3702,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3852,7 +3834,7 @@ def __init__( class CustomContainerUserSourceInfo(UserSourceInfo): """Custom container user source info. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4010,7 +3992,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -4064,7 +4046,7 @@ class CustomizedAcceleratorProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar provisioning_state: State of the customized accelerator. Known values are: "Creating", "Updating", "Succeeded", "Failed", and "Deleting". @@ -4257,7 +4239,7 @@ def __init__( class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -5062,7 +5044,7 @@ class ProbeAction(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ExecAction, HTTPGetAction, TCPSocketAction - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -5090,7 +5072,7 @@ def __init__(self, **kwargs: Any) -> None: class ExecAction(ProbeAction): """ExecAction describes a "run in container" action. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -5988,7 +5970,7 @@ def __init__( class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -6090,7 +6072,7 @@ def __init__( class HTTPGetAction(ProbeAction): """HTTPGetAction describes an action based on HTTP Get requests. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -6286,7 +6268,7 @@ class UploadedUserSourceInfo(UserSourceInfo): You probably want to use the sub-classes and not this class directly. Known sub-classes are: JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -6329,7 +6311,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -6385,7 +6367,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -6479,7 +6461,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -6513,7 +6495,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -6967,7 +6949,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -7000,7 +6982,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7485,7 +7467,7 @@ class Probe(_serialization.Model): """Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive traffic. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar probe_action: The action of the probe. :vartype probe_action: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ProbeAction @@ -7567,7 +7549,7 @@ def __init__( class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2022_11_01_preview.models.TestKeyType @@ -8451,7 +8433,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -8505,7 +8487,7 @@ def __init__( class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -8646,7 +8628,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2022_11_01_preview.models.StorageType @@ -8671,7 +8653,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2022_11_01_preview.models.StorageType @@ -9100,7 +9082,7 @@ def __init__( class TCPSocketAction(ProbeAction): """TCPSocketAction describes an action based on opening a socket. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_api_portal_custom_domains_operations.py index b988350bdd0..90affb8b76e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_api_portals_operations.py index f8d38da2c6a..9ff21975be8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -465,20 +438,9 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -524,17 +486,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -555,22 +515,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,11 +539,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -599,14 +554,6 @@ def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -636,7 +583,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,17 +592,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: @@ -666,7 +609,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.ApiPortalResource] @@ -691,17 +633,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -712,14 +653,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -729,11 +670,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -745,10 +686,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload def validate_domain( self, @@ -775,7 +712,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -787,7 +723,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -802,11 +738,10 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -818,7 +753,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -831,13 +766,9 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -867,7 +798,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -876,16 +807,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +827,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_application_accelerators_operations.py index 9946701bf8e..ac07facd65c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -204,7 +204,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -230,17 +229,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -251,14 +249,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -268,11 +266,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -284,10 +282,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -301,7 +295,6 @@ def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -322,22 +315,21 @@ def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,20 +341,16 @@ def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -390,7 +378,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -399,16 +387,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,10 +415,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -459,14 +442,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -480,7 +455,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -496,18 +471,10 @@ def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -521,7 +488,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -534,20 +501,9 @@ def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -583,7 +539,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -593,17 +549,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -624,22 +578,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -649,11 +602,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -668,14 +617,6 @@ def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -705,7 +646,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -714,14 +655,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_application_live_views_operations.py index 46481358b66..a06ef6bc28a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -198,7 +198,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -224,17 +223,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -245,14 +243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -262,11 +260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -278,10 +276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -295,7 +289,6 @@ def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -316,22 +309,21 @@ def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,20 +335,16 @@ def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -526,20 +493,9 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -616,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_apps_operations.py index 3dcf6d996f6..0b715475ac0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -373,23 +372,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -401,20 +399,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -442,7 +436,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -451,16 +445,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -483,10 +476,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -512,14 +501,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -533,7 +514,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -548,18 +529,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -573,7 +546,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -586,19 +559,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -634,7 +596,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -644,17 +606,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -675,22 +635,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -700,11 +659,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -719,14 +674,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -756,7 +703,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -765,24 +712,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -810,7 +753,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -819,16 +762,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -848,10 +790,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -877,14 +815,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -898,7 +828,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -913,18 +843,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -938,7 +860,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -950,20 +872,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -999,7 +910,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1009,17 +920,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1030,7 +939,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.AppResource] @@ -1055,17 +963,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1076,14 +983,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1093,11 +1000,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1109,10 +1016,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1126,7 +1029,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1147,22 +1049,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,20 +1075,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1215,7 +1112,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1224,16 +1121,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1253,10 +1149,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1283,14 +1175,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1304,7 +1188,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1319,18 +1203,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1344,7 +1220,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1357,20 +1233,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1406,7 +1271,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1416,17 +1281,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1454,7 +1317,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1466,7 +1328,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1481,11 +1343,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1497,7 +1358,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1510,13 +1371,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1546,7 +1403,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1555,16 +1412,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,10 +1432,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_bindings_operations.py index 28cd5537329..c0f3821305b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -871,20 +793,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.BindingResource] @@ -981,18 +889,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +910,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1020,11 +927,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1035,7 +942,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_build_service_agent_pool_operations.py index 6730e56155f..e1deb3e3069 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -209,18 +208,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -231,14 +229,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -248,11 +246,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -264,10 +262,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -283,7 +277,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -304,23 +297,22 @@ def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -332,13 +324,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -346,7 +334,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -374,7 +362,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -384,16 +372,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -413,10 +400,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -446,14 +429,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -468,7 +443,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -485,18 +460,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -511,7 +478,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -526,20 +493,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -576,7 +532,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +542,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_build_service_builder_operations.py index cf9311ab7f4..7c5f5b58933 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -261,7 +261,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -282,23 +281,22 @@ def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -310,13 +308,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -324,7 +318,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -352,7 +346,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -362,16 +356,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -391,10 +384,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -423,14 +412,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -445,7 +426,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -462,18 +443,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -488,7 +461,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -503,20 +476,9 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -553,7 +515,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -563,17 +525,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -594,23 +554,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -620,11 +579,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -641,14 +596,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -679,7 +626,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -688,17 +635,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -713,7 +656,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.BuilderResource] @@ -738,18 +680,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -760,14 +701,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -777,11 +718,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,10 +734,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -812,7 +749,6 @@ def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -833,23 +769,22 @@ def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -861,10 +796,6 @@ def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_build_service_operations.py index da1b27821a5..f586d692a62 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -532,7 +532,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildService] @@ -557,17 +556,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -578,14 +576,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -595,11 +593,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -611,10 +609,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -628,7 +622,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -649,22 +642,21 @@ def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -676,13 +668,9 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -697,7 +685,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -721,18 +708,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -743,14 +729,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -760,11 +746,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -776,10 +762,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -795,7 +777,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -816,23 +797,22 @@ def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -844,13 +824,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -880,7 +856,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -893,7 +868,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -910,11 +885,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -927,7 +901,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -941,13 +915,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2022_11_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2022_11_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -977,7 +947,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -987,16 +957,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1016,10 +985,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1035,7 +1000,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildResult] @@ -1060,19 +1024,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1083,14 +1046,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1100,11 +1063,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1116,10 +1079,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1143,7 +1102,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1164,7 +1122,7 @@ def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1172,16 +1130,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1193,13 +1150,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1224,7 +1177,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1245,7 +1197,7 @@ def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1253,16 +1205,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1274,13 +1225,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1295,7 +1242,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1316,22 +1262,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1343,13 +1288,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1364,7 +1305,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1385,22 +1325,21 @@ def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1412,13 +1351,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1435,7 +1370,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1456,23 +1390,22 @@ def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1484,13 +1417,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1505,7 +1434,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1526,22 +1454,21 @@ def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1553,13 +1480,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -1576,7 +1499,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1597,23 +1519,22 @@ def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1625,10 +1546,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_buildpack_binding_operations.py index 8f8133198ce..2291f1bc2ca 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -243,7 +243,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -264,7 +263,7 @@ def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -272,16 +271,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -308,7 +302,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -336,7 +330,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -347,16 +341,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -376,10 +369,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -413,14 +402,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -436,7 +417,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -456,18 +437,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -483,7 +456,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -500,20 +473,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -551,7 +513,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -561,17 +523,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -598,7 +558,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -606,16 +566,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -625,11 +584,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -654,14 +609,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -693,7 +640,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -702,17 +649,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -729,7 +672,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -755,19 +697,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -778,14 +719,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -795,11 +736,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -810,7 +751,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_certificates_operations.py index ab51c1fdb1c..d0d542e0531 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -493,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -524,22 +484,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -549,11 +508,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -568,14 +523,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -605,7 +552,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -614,17 +561,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -637,7 +580,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.CertificateResource] @@ -662,17 +604,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -683,14 +624,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -700,11 +641,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -715,7 +656,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_config_servers_operations.py index 10ef541b9b9..3436d90be5c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -474,23 +436,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -518,7 +478,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -526,16 +486,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,10 +514,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -582,14 +537,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -602,7 +549,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -615,18 +562,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -639,7 +578,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -650,20 +589,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -698,7 +626,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -708,23 +636,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -752,7 +678,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -760,16 +686,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -789,10 +714,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -816,14 +737,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -836,7 +749,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -849,18 +762,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -873,7 +778,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -884,20 +789,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -932,7 +826,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -944,14 +838,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_configuration_services_operations.py index 8d61dac8123..40b31e52b07 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -393,14 +382,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -414,7 +395,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -430,18 +411,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -469,20 +442,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -559,22 +519,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,11 +543,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -603,14 +558,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -640,7 +587,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -649,17 +596,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -672,7 +615,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -698,17 +640,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -719,14 +660,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -736,11 +677,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -752,16 +693,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -789,7 +726,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -798,16 +735,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -827,10 +763,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -856,14 +788,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -877,7 +801,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -892,18 +816,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -917,7 +833,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -930,20 +846,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -979,7 +884,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -991,14 +896,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_custom_domains_operations.py index 39f8bbc3241..2e48ce199c8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -871,20 +793,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -982,18 +890,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1004,14 +911,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1021,11 +928,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,7 +943,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_customized_accelerators_operations.py index badd1e3af7e..ed291e10437 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -272,7 +272,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -298,18 +297,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -320,14 +318,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -337,11 +335,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +351,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace def get( self, @@ -377,7 +371,6 @@ def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -398,23 +391,22 @@ def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,13 +418,9 @@ def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -440,7 +428,7 @@ def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -468,7 +456,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -478,16 +466,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -507,10 +494,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -541,14 +524,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -563,7 +538,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +556,10 @@ def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -607,7 +574,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -622,20 +589,9 @@ def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -672,7 +628,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -682,17 +638,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -718,23 +672,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -744,11 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -770,14 +719,6 @@ def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -808,7 +749,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -817,17 +758,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def validate( @@ -858,7 +795,6 @@ def validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -872,7 +808,7 @@ def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -889,11 +825,10 @@ def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -907,7 +842,7 @@ def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -922,13 +857,9 @@ def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -959,7 +890,7 @@ def validate( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -969,16 +900,15 @@ def validate( content_type=content_type, json=_json, content=_content, - template_url=self.validate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -992,10 +922,6 @@ def validate( deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_deployments_operations.py index f4bd2c41282..2a325fb591b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -468,7 +468,7 @@ def build_disable_remote_debugging_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_remote_debugging_config_request( +def build_get_remote_debugging_config_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, app_name: str, @@ -702,7 +702,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -723,23 +722,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,13 +749,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -765,7 +759,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -793,7 +787,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -803,16 +797,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -835,10 +828,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -868,14 +857,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -890,7 +871,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -907,18 +888,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -933,7 +906,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -948,20 +921,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -998,7 +960,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1008,17 +970,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1039,23 +999,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1065,11 +1024,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -1086,14 +1041,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1124,7 +1071,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1133,17 +1080,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1151,7 +1094,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1179,7 +1122,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1189,16 +1132,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1218,10 +1160,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1251,14 +1189,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1273,7 +1203,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1290,18 +1220,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1316,7 +1238,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1331,20 +1253,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1381,7 +1292,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1391,17 +1302,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1423,7 +1332,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentResource] @@ -1448,19 +1356,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1471,14 +1378,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1488,11 +1395,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1504,10 +1411,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1521,7 +1424,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.DeploymentResource] @@ -1546,18 +1448,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1568,14 +1469,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1585,11 +1486,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1601,10 +1502,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1624,23 +1521,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1650,11 +1546,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1671,14 +1563,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1709,7 +1593,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1718,17 +1602,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1749,23 +1629,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1775,11 +1654,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1796,14 +1671,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1834,7 +1701,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1843,17 +1710,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1874,23 +1737,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1900,11 +1762,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1921,14 +1779,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1959,7 +1809,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1968,17 +1818,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_remote_debugging_initial( self, @@ -1986,7 +1832,7 @@ def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -2017,7 +1863,7 @@ def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2027,16 +1873,15 @@ def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2056,10 +1901,6 @@ def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload def begin_enable_remote_debugging( self, @@ -2089,14 +1930,6 @@ def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2111,7 +1944,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2128,18 +1961,10 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2154,7 +1979,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> LROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -2169,20 +1994,9 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of LROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -2219,7 +2033,7 @@ def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2229,17 +2043,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2260,23 +2072,22 @@ def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2296,10 +2107,6 @@ def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2315,14 +2122,6 @@ def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -2356,7 +2155,7 @@ def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2366,17 +2165,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def get_remote_debugging_config( @@ -2393,7 +2190,6 @@ def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -2414,23 +2210,22 @@ def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2442,13 +2237,9 @@ def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace def get_log_file_url( @@ -2465,7 +2256,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -2486,23 +2276,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2516,13 +2305,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2530,7 +2315,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2558,7 +2343,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2568,16 +2353,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2587,11 +2371,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2622,14 +2402,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2642,7 +2414,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2659,18 +2431,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2683,7 +2447,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2698,20 +2462,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2745,7 +2498,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2754,17 +2507,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2772,7 +2521,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2800,7 +2549,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2810,16 +2559,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2829,11 +2577,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2864,14 +2608,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2884,7 +2620,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2901,18 +2637,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2925,7 +2653,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2940,20 +2668,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2987,7 +2704,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2996,17 +2713,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -3014,7 +2727,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -3042,7 +2755,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -3052,16 +2765,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -3071,11 +2783,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -3106,14 +2814,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -3126,7 +2826,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -3143,18 +2843,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -3167,7 +2859,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -3182,20 +2874,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -3229,7 +2910,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3238,14 +2919,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_dev_tool_portals_operations.py index 420313af16c..354662036c3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -198,7 +198,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -224,17 +223,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -245,14 +243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -262,11 +260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -278,10 +276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -295,7 +289,6 @@ def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -316,22 +309,21 @@ def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,20 +335,16 @@ def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -526,20 +493,9 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of LROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -616,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_gateway_custom_domains_operations.py index 6bd32018584..9c22272242a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_gateway_route_configs_operations.py index 2cd72208526..14fd732aeaa 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload def begin_create_or_update( self, @@ -388,14 +377,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -410,7 +391,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -429,18 +410,10 @@ def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -471,20 +444,9 @@ def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -521,7 +483,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -531,17 +493,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -562,23 +522,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,11 +547,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -609,14 +564,6 @@ def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -647,7 +594,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -656,17 +603,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -681,7 +624,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -707,18 +649,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -729,14 +670,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -746,11 +687,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -761,7 +702,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_gateways_operations.py index aaeaed53c27..c0ebc7402d8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -267,7 +267,6 @@ def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -288,22 +287,21 @@ def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -315,20 +313,16 @@ def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -356,7 +350,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -365,16 +359,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -394,10 +387,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload def begin_create_or_update( self, @@ -423,14 +412,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -444,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -459,18 +440,10 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -484,7 +457,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -497,20 +470,9 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -546,7 +508,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -556,17 +518,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -587,22 +547,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,11 +571,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -631,14 +586,6 @@ def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -668,7 +615,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -677,17 +624,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_env_secrets( @@ -702,7 +645,6 @@ def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -723,22 +665,21 @@ def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -750,13 +691,9 @@ def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: @@ -767,7 +704,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.GatewayResource] @@ -792,17 +728,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -813,14 +748,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -830,11 +765,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -846,10 +781,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload def validate_domain( self, @@ -876,7 +807,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -888,7 +818,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -903,11 +833,10 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -919,7 +848,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -932,13 +861,9 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -968,7 +893,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -977,16 +902,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -998,10 +922,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_monitoring_settings_operations.py index ddce726779d..2d01c358a90 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -440,23 +402,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -484,7 +444,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -492,16 +452,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -521,10 +480,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -548,14 +503,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -568,7 +515,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +528,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -605,7 +544,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -616,20 +555,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_11_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -664,7 +592,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -674,14 +602,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_operations.py index a2e6f2a5b39..f04cc61a8b0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_predefined_accelerators_operations.py index 8bc261978c1..0a71306bc4a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -225,7 +225,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -251,18 +250,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -273,14 +271,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -290,11 +288,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +304,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace def get( self, @@ -330,7 +324,6 @@ def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -351,23 +344,22 @@ def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -379,13 +371,9 @@ def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -411,23 +399,22 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +424,7 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_disable( @@ -463,14 +446,6 @@ def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -501,7 +476,7 @@ def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -510,17 +485,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -546,23 +517,22 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -572,11 +542,7 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_enable( @@ -598,14 +564,6 @@ def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -636,7 +594,7 @@ def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,14 +603,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_runtime_versions_operations.py index 22fcf2d6ca0..7b97db9c5cd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_service_registries_operations.py index 0c65f1c9d0a..6ee69dad977 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -217,22 +216,21 @@ def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,13 +242,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -271,22 +265,21 @@ def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +299,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -323,14 +312,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -373,17 +354,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -404,22 +383,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,11 +407,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -448,14 +422,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -485,7 +451,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -494,17 +460,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -517,7 +479,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -543,17 +504,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -581,11 +541,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +556,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_services_operations.py index 906654bdedf..05eeb0a225e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -466,7 +466,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -487,21 +486,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -513,16 +511,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -549,7 +547,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -557,16 +555,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,10 +586,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -615,14 +608,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -635,7 +620,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -648,18 +633,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -669,7 +646,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -679,19 +660,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -726,7 +696,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -736,17 +706,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -767,21 +735,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -791,11 +758,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -806,14 +769,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -842,7 +797,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -851,20 +806,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -891,7 +846,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -899,16 +854,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -928,10 +882,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -954,14 +904,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -974,7 +916,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -987,18 +929,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1008,7 +942,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1017,20 +955,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1065,7 +992,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1075,17 +1002,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1096,7 +1021,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1117,21 +1041,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1143,13 +1066,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1174,7 +1093,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1185,7 +1103,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1198,11 +1116,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1213,7 +1130,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1224,13 +1141,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_11_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1260,7 +1173,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1268,16 +1181,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1289,13 +1201,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1308,7 +1216,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1329,21 +1236,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1353,11 +1259,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1368,7 +1270,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1389,21 +1290,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1415,13 +1315,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1442,35 +1338,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1481,14 +1372,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1517,7 +1400,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1526,17 +1409,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1557,35 +1436,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1596,14 +1470,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1632,7 +1498,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1641,17 +1507,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -1672,7 +1534,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1680,18 +1541,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1699,20 +1564,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2022_11_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_11_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1742,23 +1606,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1770,19 +1633,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceResource] @@ -1807,15 +1665,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1826,14 +1683,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1843,11 +1700,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1859,8 +1716,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1868,7 +1723,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.ServiceResource] @@ -1893,16 +1747,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1913,14 +1766,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1930,11 +1783,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1945,7 +1798,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_skus_operations.py index 57ea8446280..20a897c333f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_storages_operations.py index 8a1268fe0c3..82ffe135f73 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_11_01_preview/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_11_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -359,14 +348,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -380,7 +361,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -395,18 +376,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -420,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -433,20 +406,9 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2022_11_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -482,7 +444,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -492,17 +454,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -523,22 +483,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +507,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -567,14 +522,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -604,7 +551,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -613,17 +560,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -634,7 +577,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_11_01_preview.models.StorageResource] @@ -659,17 +601,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -680,14 +621,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -697,11 +638,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -712,7 +653,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/_app_platform_management_client.py index 38f0f4e6e19..75a549dfa13 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -129,7 +131,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -191,7 +211,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2022-12-01" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -211,7 +231,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/_configuration.py index 6f80dc3c39b..d9abaca1ce8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2022-12-01") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/_app_platform_management_client.py index 8726b7751ac..5e0dfaeb16d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -132,7 +134,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -194,7 +214,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2022-12-01" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -214,7 +236,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/_configuration.py index ff57906b900..4b05d2af3a5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2022-12-01") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_api_portal_custom_domains_operations.py index e8a8724151d..0f4379fe84d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,23 +95,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,13 +122,9 @@ async def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -138,7 +132,7 @@ async def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -237,14 +226,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -259,7 +240,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -277,18 +258,10 @@ async def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -303,7 +276,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -318,20 +291,9 @@ async def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_12_01.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -366,7 +328,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -376,17 +338,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -405,23 +365,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -431,11 +390,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -452,14 +407,6 @@ async def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -488,7 +435,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -497,17 +444,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -522,7 +465,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -546,18 +488,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -568,14 +509,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -585,11 +526,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -600,7 +541,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_api_portals_operations.py index 4cd0c53b46d..77c6909988a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,20 +120,16 @@ async def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -161,7 +155,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -170,16 +164,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -199,10 +192,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload async def begin_create_or_update( self, @@ -228,14 +217,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -249,7 +230,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -264,18 +245,10 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -289,7 +262,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -302,19 +275,9 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. - :type api_portal_resource: ~azure.mgmt.appplatform.v2022_12_01.models.ApiPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ApiPortalResource type or a IO[bytes] type. Required. + :type api_portal_resource: ~azure.mgmt.appplatform.v2022_12_01.models.ApiPortalResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -348,7 +311,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -358,17 +321,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -387,22 +348,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -412,11 +372,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -431,14 +387,6 @@ async def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -466,7 +414,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -475,17 +423,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -498,7 +442,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.ApiPortalResource] @@ -521,17 +464,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -542,14 +484,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -559,11 +501,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -575,10 +517,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload async def validate_domain( self, @@ -604,7 +542,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -616,7 +553,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -631,11 +568,10 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -647,7 +583,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -660,13 +596,9 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -694,7 +626,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -703,16 +635,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -724,10 +655,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_apps_operations.py index 42e7508ea7c..406de3a9e5a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -105,23 +104,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,20 +131,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -172,7 +166,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -181,16 +175,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -213,10 +206,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -278,18 +259,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -303,7 +276,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -316,19 +289,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_12_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_12_01.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -362,7 +324,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -372,17 +334,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -401,22 +361,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,11 +385,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -445,14 +400,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -489,24 +436,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -532,7 +475,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -541,16 +484,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -570,10 +512,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -599,14 +537,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -620,7 +550,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -635,18 +565,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -660,7 +582,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -672,20 +594,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_12_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_12_01.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -719,7 +630,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -729,17 +640,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -750,7 +659,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.AppResource] @@ -773,17 +681,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -794,14 +701,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -811,11 +718,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -827,10 +734,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -844,7 +747,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -863,22 +765,21 @@ async def get_resource_upload_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -890,20 +791,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -929,7 +826,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -938,16 +835,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -967,10 +863,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -997,14 +889,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1018,7 +902,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1033,18 +917,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1058,7 +934,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1071,20 +947,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2022_12_01.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1118,7 +983,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1128,17 +993,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1165,7 +1028,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1177,7 +1039,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1192,11 +1054,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1208,7 +1069,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1221,13 +1082,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1255,7 +1112,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1264,16 +1121,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1285,10 +1141,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_bindings_operations.py index e5e062a7f1c..5a3bc0822a5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,23 +96,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,13 +123,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -139,7 +133,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -239,14 +228,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -261,7 +242,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -278,18 +259,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -304,7 +277,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -319,19 +292,8 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2022_12_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + BindingResource type or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2022_12_01.models.BindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -366,7 +328,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -376,17 +338,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -405,23 +365,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -431,11 +390,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -452,14 +407,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -488,7 +435,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -497,17 +444,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -515,7 +458,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -541,7 +484,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -551,16 +494,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,10 +522,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -612,14 +550,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -634,7 +564,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -651,18 +581,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -677,7 +599,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -692,19 +614,8 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2022_12_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2022_12_01.models.BindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -739,7 +650,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -749,17 +660,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -774,7 +683,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.BindingResource] @@ -797,18 +705,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -819,14 +726,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -836,11 +743,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -851,7 +758,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_build_service_agent_pool_operations.py index 03c43edc33d..285e320c1f5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -98,18 +97,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -172,7 +166,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,23 +184,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -219,13 +211,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -233,7 +221,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -259,7 +247,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -269,16 +257,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -298,10 +285,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -331,14 +314,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -353,7 +328,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -370,18 +345,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -396,7 +363,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -411,20 +378,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2022_12_01.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -459,7 +415,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -469,14 +425,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_build_service_builder_operations.py index 3ae76fdf704..be6590afe18 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,23 +96,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,13 +123,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -139,7 +133,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -204,10 +197,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -236,14 +225,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -258,7 +239,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -275,18 +256,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -301,7 +274,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -316,19 +289,8 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. - :type builder_resource: ~azure.mgmt.appplatform.v2022_12_01.models.BuilderResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + BuilderResource type or a IO[bytes] type. Required. + :type builder_resource: ~azure.mgmt.appplatform.v2022_12_01.models.BuilderResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -363,7 +325,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -373,17 +335,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -402,23 +362,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,11 +387,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -449,14 +404,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -485,7 +432,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -494,17 +441,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -519,7 +462,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.BuilderResource] @@ -542,18 +484,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +505,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -581,11 +522,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -597,10 +538,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace_async async def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -616,7 +553,6 @@ async def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -635,23 +571,22 @@ async def list_deployments( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -663,10 +598,6 @@ async def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_build_service_operations.py index 6ebde8f56aa..f77dd6473b9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.BuildService] @@ -103,17 +102,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -124,14 +122,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -141,11 +139,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,10 +155,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -174,7 +168,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -193,22 +186,21 @@ async def get_build_service( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -220,13 +212,9 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -241,7 +229,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.Build] @@ -264,18 +251,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -286,14 +272,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -303,11 +289,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -319,10 +305,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -338,7 +320,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -357,23 +338,22 @@ async def get_build( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -385,13 +365,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -421,7 +397,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -434,7 +409,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -451,11 +426,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -468,7 +442,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -482,13 +456,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2022_12_01.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2022_12_01.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -516,7 +486,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -526,16 +496,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,10 +524,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -574,7 +539,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.BuildResult] @@ -597,19 +561,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -620,14 +583,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -637,11 +600,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -653,10 +616,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -680,7 +639,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -699,7 +657,7 @@ async def get_build_result( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -707,16 +665,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -728,13 +685,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -759,7 +712,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -778,7 +730,7 @@ async def get_build_result_log( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -786,16 +738,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -807,13 +758,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -828,7 +775,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -847,22 +793,21 @@ async def get_resource_upload_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -874,13 +819,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -895,7 +836,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -914,22 +854,21 @@ async def list_supported_buildpacks( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -941,13 +880,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -964,7 +899,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -983,23 +917,22 @@ async def get_supported_buildpack( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1011,13 +944,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1032,7 +961,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1051,22 +979,21 @@ async def list_supported_stacks( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1078,13 +1005,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1101,7 +1024,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1120,23 +1042,22 @@ async def get_supported_stack( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1148,10 +1069,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_buildpack_binding_operations.py index 24c2e150269..4d050515848 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -85,7 +85,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -104,7 +103,7 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -112,16 +111,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,13 +131,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -148,7 +142,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -174,7 +168,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -185,16 +179,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -214,10 +207,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -250,14 +239,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -273,7 +254,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -293,18 +274,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -320,7 +293,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -337,20 +310,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: ~azure.mgmt.appplatform.v2022_12_01.models.BuildpackBindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -386,7 +348,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -396,17 +358,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -431,7 +391,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -439,16 +399,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -458,11 +417,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -487,14 +442,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -524,7 +471,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -533,17 +480,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -560,7 +503,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -584,19 +526,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -607,14 +548,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -624,11 +565,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -639,7 +580,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_certificates_operations.py index e4c86b2a400..9a46ba2780b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -94,22 +93,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,20 +119,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -160,7 +154,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -169,16 +163,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -201,10 +194,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -230,14 +219,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -251,7 +232,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -266,18 +247,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -291,7 +264,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -304,20 +277,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: ~azure.mgmt.appplatform.v2022_12_01.models.CertificateResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -351,7 +313,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -361,17 +323,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -390,22 +350,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -415,11 +374,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -434,14 +389,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -469,7 +416,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -478,17 +425,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -501,7 +444,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.CertificateResource] @@ -524,17 +466,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -545,14 +486,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -562,11 +503,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -577,7 +518,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_config_servers_operations.py index a6542814789..91109c73fcc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -87,21 +86,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -113,19 +111,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -151,7 +145,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -159,16 +153,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -188,10 +181,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -214,14 +203,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -234,7 +215,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -247,18 +228,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -271,7 +244,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -282,20 +255,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2022_12_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -328,7 +290,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -338,23 +300,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -380,7 +340,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -388,16 +348,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -417,10 +376,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -443,14 +398,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -463,7 +410,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -476,18 +423,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -500,7 +439,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -511,20 +450,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2022_12_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -557,7 +485,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -567,23 +495,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -609,7 +535,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -617,16 +543,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -646,10 +571,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -672,14 +593,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -692,7 +605,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -705,18 +618,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -729,7 +634,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -740,20 +645,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: ~azure.mgmt.appplatform.v2022_12_01.models.ConfigServerSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -786,7 +680,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -798,14 +692,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_configuration_services_operations.py index a466f215f45..8e17fceebdc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,20 +120,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -161,7 +155,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -170,16 +164,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -199,10 +192,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -230,14 +219,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -251,7 +232,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -267,18 +248,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -292,7 +265,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -306,20 +279,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2022_12_01.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -353,7 +315,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -363,17 +325,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -392,22 +352,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -417,11 +376,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -436,14 +391,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -471,7 +418,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -480,17 +427,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -503,7 +446,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -527,17 +469,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -548,14 +489,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -565,11 +506,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -581,16 +522,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -616,7 +553,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -625,16 +562,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -654,10 +590,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -683,14 +615,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -704,7 +628,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -719,18 +643,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -744,7 +660,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -757,19 +673,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. - :type settings: ~azure.mgmt.appplatform.v2022_12_01.models.ConfigurationServiceSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ConfigurationServiceSettings type or a IO[bytes] type. Required. + :type settings: ~azure.mgmt.appplatform.v2022_12_01.models.ConfigurationServiceSettings or + IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -803,7 +709,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -815,14 +721,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_custom_domains_operations.py index a5644230295..edd50755e18 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,23 +96,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,13 +123,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -139,7 +133,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -239,14 +228,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -261,7 +242,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -278,18 +259,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -304,7 +277,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -319,19 +292,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -366,7 +329,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -376,17 +339,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -405,23 +366,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -431,11 +391,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -452,14 +408,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -488,7 +436,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -497,17 +445,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -515,7 +459,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -541,7 +485,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -551,16 +495,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,10 +523,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -612,14 +551,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -634,7 +565,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -651,18 +582,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -677,7 +600,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -692,19 +615,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -739,7 +652,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -749,17 +662,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -774,7 +685,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -798,18 +708,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -820,14 +729,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -837,11 +746,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -852,7 +761,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_deployments_operations.py index 1ffcdd3e0ba..b9ae44588bf 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -89,7 +89,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -108,23 +107,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -136,13 +134,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -150,7 +144,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -176,7 +170,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -186,16 +180,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,10 +211,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -250,14 +239,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -272,7 +253,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -289,18 +270,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -315,7 +288,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -330,19 +303,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2022_12_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + DeploymentResource type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2022_12_01.models.DeploymentResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -377,7 +340,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -387,17 +350,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -416,23 +377,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +402,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +419,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -499,7 +447,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +456,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +470,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -552,7 +496,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -562,16 +506,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -591,10 +534,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -623,14 +562,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -645,7 +576,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -662,18 +593,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -688,7 +611,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -703,19 +626,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2022_12_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2022_12_01.models.DeploymentResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -750,7 +663,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -760,17 +673,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -792,7 +703,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.DeploymentResource] @@ -815,19 +725,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -838,14 +747,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -855,11 +764,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -871,10 +780,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -888,7 +793,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.DeploymentResource] @@ -911,18 +815,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -933,14 +836,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -950,11 +853,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -966,10 +869,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -987,23 +886,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1013,11 +911,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1034,14 +928,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1070,7 +956,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1079,17 +965,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1108,23 +990,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1134,11 +1015,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1155,14 +1032,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1191,7 +1060,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1200,17 +1069,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1229,23 +1094,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1255,11 +1119,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1276,14 +1136,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1312,7 +1164,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1321,17 +1173,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_remote_debugging_initial( self, @@ -1339,7 +1187,7 @@ async def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -1368,7 +1216,7 @@ async def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1378,16 +1226,15 @@ async def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1407,10 +1254,6 @@ async def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload async def begin_enable_remote_debugging( self, @@ -1440,14 +1283,6 @@ async def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1462,7 +1297,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1479,18 +1314,10 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1505,7 +1332,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> AsyncLROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -1520,20 +1347,9 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2022_12_01.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -1568,7 +1384,7 @@ async def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1578,17 +1394,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1607,23 +1421,22 @@ async def _disable_remote_debugging_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1643,10 +1456,6 @@ async def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace_async async def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1662,14 +1471,6 @@ async def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -1701,7 +1502,7 @@ async def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1711,17 +1512,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def get_remote_debugging_config( @@ -1738,7 +1537,6 @@ async def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -1757,23 +1555,22 @@ async def get_remote_debugging_config( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1785,13 +1582,9 @@ async def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1808,7 +1601,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1827,23 +1619,22 @@ async def get_log_file_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1857,13 +1648,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1871,7 +1658,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1897,7 +1684,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1907,16 +1694,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1926,11 +1712,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -1960,14 +1742,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1980,7 +1754,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1997,18 +1771,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2021,7 +1787,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -2036,20 +1802,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2022_12_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -2081,7 +1836,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2090,17 +1845,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2108,7 +1859,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2134,7 +1885,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2144,16 +1895,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2163,11 +1913,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -2197,14 +1943,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2217,7 +1955,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2234,18 +1972,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2258,7 +1988,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -2273,20 +2003,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2022_12_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -2318,7 +2037,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2327,17 +2046,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2345,7 +2060,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2371,7 +2086,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2381,16 +2096,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2400,11 +2114,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2434,14 +2144,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2454,7 +2156,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2471,18 +2173,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2495,7 +2189,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2510,20 +2204,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2022_12_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -2555,7 +2238,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2564,14 +2247,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_gateway_custom_domains_operations.py index e230cb342d9..97f508d9513 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,23 +95,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,13 +122,9 @@ async def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -138,7 +132,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -237,14 +226,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -259,7 +240,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -277,18 +258,10 @@ async def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -303,7 +276,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -318,20 +291,9 @@ async def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_12_01.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -366,7 +328,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -376,17 +338,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -405,23 +365,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -431,11 +390,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -452,14 +407,6 @@ async def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -488,7 +435,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -497,17 +444,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -522,7 +465,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -546,18 +488,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -568,14 +509,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -585,11 +526,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -600,7 +541,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_gateway_route_configs_operations.py index db7245dca06..3611ddbfc59 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,23 +95,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,13 +122,9 @@ async def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -138,7 +132,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload async def begin_create_or_update( self, @@ -238,14 +227,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -260,7 +241,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -279,18 +260,10 @@ async def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -305,7 +278,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -321,20 +294,9 @@ async def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2022_12_01.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -369,7 +331,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -379,17 +341,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -408,23 +368,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,11 +393,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -455,14 +410,6 @@ async def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -491,7 +438,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -500,17 +447,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -525,7 +468,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -549,18 +491,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -571,14 +512,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -588,11 +529,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -603,7 +544,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_gateways_operations.py index 2281e3d0b72..a4bb63c96fb 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,20 +120,16 @@ async def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -161,7 +155,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -170,16 +164,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -199,10 +192,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload async def begin_create_or_update( self, @@ -228,14 +217,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -249,7 +230,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -264,18 +245,10 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -289,7 +262,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -302,19 +275,8 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. - :type gateway_resource: ~azure.mgmt.appplatform.v2022_12_01.models.GatewayResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + GatewayResource type or a IO[bytes] type. Required. + :type gateway_resource: ~azure.mgmt.appplatform.v2022_12_01.models.GatewayResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -348,7 +310,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -358,17 +320,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -387,22 +347,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -412,11 +371,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -431,14 +386,6 @@ async def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -466,7 +413,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -475,17 +422,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -498,7 +441,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.GatewayResource] @@ -521,17 +463,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -542,14 +483,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -559,11 +500,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -575,10 +516,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload async def validate_domain( self, @@ -604,7 +541,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -616,7 +552,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -631,11 +567,10 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -647,7 +582,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -660,13 +595,9 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -694,7 +625,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -703,16 +634,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -724,10 +654,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_monitoring_settings_operations.py index 1bf84871d12..64930e4866f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -88,21 +87,20 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -114,19 +112,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -152,7 +146,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -160,16 +154,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -189,10 +182,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -216,14 +205,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -236,7 +217,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -249,18 +230,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -273,7 +246,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -284,20 +257,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_12_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -330,7 +292,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -340,23 +302,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -382,7 +342,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -390,16 +350,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -419,10 +378,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -446,14 +401,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -466,7 +413,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -479,18 +426,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -503,7 +442,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -514,20 +453,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_12_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -560,7 +488,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -570,14 +498,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_operations.py index b2e29df419f..088dd8a351c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.OperationDetail] @@ -80,14 +79,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -98,14 +96,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -115,11 +113,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -130,5 +128,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_runtime_versions_operations.py index 34181644db3..0e878a06800 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -74,18 +73,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -97,8 +95,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_service_registries_operations.py index 90464bef1a9..f2583ee53e0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -93,22 +92,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -120,13 +118,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -145,22 +139,21 @@ async def _create_or_update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -180,10 +173,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -197,14 +186,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -235,7 +216,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -245,17 +226,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -274,22 +253,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -299,11 +277,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -318,14 +292,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -353,7 +319,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -362,17 +328,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -385,7 +347,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -409,17 +370,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -430,14 +390,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -447,11 +407,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -462,7 +422,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_services_operations.py index 7d0f6f32af3..45f957da1cf 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,21 +98,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,16 +123,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -159,7 +157,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -167,16 +165,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -199,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -225,14 +218,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -245,7 +230,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -258,18 +243,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -279,7 +256,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -289,19 +270,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_12_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_12_01.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -334,7 +304,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -344,17 +314,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -373,21 +341,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -397,11 +364,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -412,14 +375,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -446,7 +401,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -455,20 +410,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -493,7 +448,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -501,16 +456,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -530,10 +484,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -556,14 +506,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -576,7 +518,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -589,18 +531,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -610,7 +544,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -619,20 +557,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_12_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_12_01.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -665,7 +592,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -675,17 +602,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -696,7 +621,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -715,21 +639,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -741,13 +664,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -772,7 +691,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -783,7 +701,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -796,11 +714,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -811,7 +728,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -822,13 +739,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2022_12_01.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_12_01.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -856,7 +769,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -864,16 +777,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -885,13 +797,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -904,7 +812,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -923,21 +830,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -947,11 +853,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -964,7 +866,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -983,21 +884,20 @@ async def enable_test_endpoint( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1009,13 +909,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1034,35 +930,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1073,14 +964,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1107,7 +990,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1116,17 +999,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1145,35 +1024,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1184,14 +1058,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1218,7 +1084,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1227,17 +1093,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -1258,7 +1120,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1266,18 +1127,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1285,20 +1150,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2022_12_01.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_12_01.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1326,23 +1190,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1354,19 +1217,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.ServiceResource] @@ -1389,15 +1247,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1408,14 +1265,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1425,11 +1282,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1441,8 +1298,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1450,7 +1305,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.ServiceResource] @@ -1473,16 +1327,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1493,14 +1346,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1510,11 +1363,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1525,7 +1378,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_skus_operations.py index c0db81010c1..1e6a2808dd2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.ResourceSku] @@ -80,15 +79,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -99,14 +97,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -116,11 +114,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -131,5 +129,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_storages_operations.py index ebb275b1537..f2103449f9f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -94,22 +93,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,20 +119,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -160,7 +154,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -169,16 +163,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -201,10 +194,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -230,14 +219,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -251,7 +232,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -266,18 +247,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -291,7 +264,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -304,19 +277,8 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. - :type storage_resource: ~azure.mgmt.appplatform.v2022_12_01.models.StorageResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + StorageResource type or a IO[bytes] type. Required. + :type storage_resource: ~azure.mgmt.appplatform.v2022_12_01.models.StorageResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -350,7 +312,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -360,17 +322,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -389,22 +349,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -414,11 +373,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -433,14 +388,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -468,7 +415,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -477,17 +424,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -500,7 +443,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.StorageResource] @@ -523,17 +465,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -544,14 +485,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -561,11 +502,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -576,7 +517,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/models/_models_py3.py index b2a5a19ffc5..2c288890f7b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/models/_models_py3.py @@ -118,24 +118,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2022_12_01.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class ApiPortalCustomDomainResource(ProxyResource): """Custom domain of the API portal. @@ -761,7 +743,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -814,7 +796,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -1645,7 +1627,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -1683,7 +1665,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2049,7 +2031,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -2318,7 +2300,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: list[~azure.mgmt.appplatform.v2022_12_01.models.GitPatternRepository] @@ -2611,7 +2593,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -2648,7 +2630,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -2955,7 +2937,7 @@ def __init__( self.git_property = git_property -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -3010,7 +2992,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3142,7 +3124,7 @@ def __init__( class CustomContainerUserSourceInfo(UserSourceInfo): """Custom container user source info. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -3299,7 +3281,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -3351,7 +3333,7 @@ def __init__(self, *, is_valid: Optional[bool] = None, message: Optional[str] = class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -3792,7 +3774,7 @@ class ProbeAction(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ExecAction, HTTPGetAction, TCPSocketAction - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -3820,7 +3802,7 @@ def __init__(self, **kwargs: Any) -> None: class ExecAction(ProbeAction): """ExecAction describes a "run in container" action. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -4632,7 +4614,7 @@ def __init__( class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -4734,7 +4716,7 @@ def __init__( class HTTPGetAction(ProbeAction): """HTTPGetAction describes an action based on HTTP Get requests. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -4924,7 +4906,7 @@ class UploadedUserSourceInfo(UserSourceInfo): You probably want to use the sub-classes and not this class directly. Known sub-classes are: JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4967,7 +4949,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -5023,7 +5005,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -5117,7 +5099,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -5151,7 +5133,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -5564,7 +5546,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -5597,7 +5579,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -5935,7 +5917,7 @@ class Probe(_serialization.Model): """Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive traffic. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar probe_action: The action of the probe. :vartype probe_action: ~azure.mgmt.appplatform.v2022_12_01.models.ProbeAction @@ -6017,7 +5999,7 @@ def __init__( class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2022_12_01.models.TestKeyType @@ -6888,7 +6870,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -6942,7 +6924,7 @@ def __init__( class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7083,7 +7065,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2022_12_01.models.StorageType @@ -7108,7 +7090,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2022_12_01.models.StorageType @@ -7529,7 +7511,7 @@ def __init__( class TCPSocketAction(ProbeAction): """TCPSocketAction describes an action based on opening a socket. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_api_portal_custom_domains_operations.py index 2872b790480..9b42b4c13c9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -242,23 +241,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -270,13 +268,9 @@ def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -284,7 +278,7 @@ def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -310,7 +304,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -320,16 +314,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,10 +342,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -383,14 +372,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -405,7 +386,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -423,18 +404,10 @@ def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -449,7 +422,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -464,20 +437,9 @@ def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_12_01.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -512,7 +474,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -522,17 +484,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -551,23 +511,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -577,11 +536,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -598,14 +553,6 @@ def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -634,7 +581,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -643,17 +590,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -668,7 +611,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -692,18 +634,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -714,14 +655,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -731,11 +672,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,7 +687,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_api_portals_operations.py index 7aa9cd9a4cb..d56cd824f65 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -254,22 +253,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -281,20 +279,16 @@ def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -320,7 +314,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -329,16 +323,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -358,10 +351,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -408,7 +389,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -423,18 +404,10 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -448,7 +421,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -461,19 +434,9 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. - :type api_portal_resource: ~azure.mgmt.appplatform.v2022_12_01.models.ApiPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ApiPortalResource type or a IO[bytes] type. Required. + :type api_portal_resource: ~azure.mgmt.appplatform.v2022_12_01.models.ApiPortalResource or + IO[bytes] :return: An instance of LROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -507,7 +470,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -517,17 +480,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -546,22 +507,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -571,11 +531,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -590,14 +546,6 @@ def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -625,7 +573,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -634,17 +582,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: @@ -655,7 +599,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.ApiPortalResource] @@ -678,17 +621,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -699,14 +641,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -716,11 +658,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -732,10 +674,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload def validate_domain( self, @@ -761,7 +699,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -773,7 +710,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -788,11 +725,10 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -804,7 +740,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -817,13 +753,9 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -851,7 +783,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -860,16 +792,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -881,10 +812,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_apps_operations.py index 55853f6e1ed..96937f06e91 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -371,23 +370,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -399,20 +397,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -438,7 +432,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -447,16 +441,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -479,10 +472,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -508,14 +497,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_12_01.models.AppResource] @@ -528,7 +509,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -543,18 +524,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_12_01.models.AppResource] @@ -567,7 +540,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -580,19 +553,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_12_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_12_01.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_12_01.models.AppResource] @@ -625,7 +587,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -635,17 +597,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -664,22 +624,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -689,11 +648,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -708,14 +663,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -743,7 +690,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -752,24 +699,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -795,7 +738,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -804,16 +747,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -833,10 +775,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -862,14 +800,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_12_01.models.AppResource] @@ -882,7 +812,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -897,18 +827,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_12_01.models.AppResource] @@ -921,7 +843,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -933,20 +855,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2022_12_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2022_12_01.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_12_01.models.AppResource] @@ -979,7 +890,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -989,17 +900,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1010,7 +919,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.AppResource] :raises ~azure.core.exceptions.HttpResponseError: @@ -1032,17 +940,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1053,14 +960,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1070,11 +977,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1086,10 +993,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1103,7 +1006,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1122,22 +1024,21 @@ def get_resource_upload_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1149,20 +1050,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1188,7 +1085,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1197,16 +1094,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1226,10 +1122,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1256,14 +1148,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_12_01.models.AppResource] @@ -1276,7 +1160,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1291,18 +1175,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_12_01.models.AppResource] @@ -1315,7 +1191,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1328,20 +1204,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2022_12_01.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_12_01.models.AppResource] @@ -1374,7 +1239,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1384,17 +1249,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1421,7 +1284,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1433,7 +1295,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1448,11 +1310,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1464,7 +1325,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1477,13 +1338,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1511,7 +1368,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1520,16 +1377,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1541,10 +1397,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_bindings_operations.py index 320a4f2c96e..8cceb396186 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -263,23 +262,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,13 +289,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -305,7 +299,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -331,7 +325,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -341,16 +335,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -373,10 +366,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -405,14 +394,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -427,7 +408,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -444,18 +425,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -470,7 +443,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -485,19 +458,8 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2022_12_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + BindingResource type or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2022_12_01.models.BindingResource or IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -532,7 +494,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -542,17 +504,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -571,23 +531,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -597,11 +556,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -618,14 +573,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -654,7 +601,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -663,17 +610,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -681,7 +624,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -707,7 +650,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -717,16 +660,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,10 +688,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -778,14 +716,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -800,7 +730,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -817,18 +747,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -843,7 +765,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -858,19 +780,8 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2022_12_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2022_12_01.models.BindingResource or IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -905,7 +816,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -915,17 +826,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -940,7 +849,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.BindingResource] @@ -963,18 +871,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -985,14 +892,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1002,11 +909,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1017,7 +924,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_build_service_agent_pool_operations.py index bc9b4f45b58..f796b8ed26e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -207,18 +206,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -229,14 +227,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -246,11 +244,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -262,10 +260,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -281,7 +275,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -300,23 +293,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -328,13 +320,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -342,7 +330,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -368,7 +356,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -378,16 +366,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -407,10 +394,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -440,14 +423,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -462,7 +437,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -479,18 +454,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -505,7 +472,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -520,20 +487,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2022_12_01.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -568,7 +524,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -578,14 +534,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_build_service_builder_operations.py index d7c7eb65b61..28dc99e9c13 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -261,7 +261,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -280,23 +279,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -308,13 +306,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -322,7 +316,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -348,7 +342,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -358,16 +352,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -387,10 +380,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -419,14 +408,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -441,7 +422,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -458,18 +439,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -484,7 +457,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -499,19 +472,8 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. - :type builder_resource: ~azure.mgmt.appplatform.v2022_12_01.models.BuilderResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + BuilderResource type or a IO[bytes] type. Required. + :type builder_resource: ~azure.mgmt.appplatform.v2022_12_01.models.BuilderResource or IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -546,7 +508,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -556,17 +518,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -585,23 +545,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -611,11 +570,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -632,14 +587,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -668,7 +615,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -677,17 +624,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -702,7 +645,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.BuilderResource] @@ -725,18 +667,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -747,14 +688,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -764,11 +705,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -780,10 +721,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -799,7 +736,6 @@ def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -818,23 +754,22 @@ def list_deployments( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -846,10 +781,6 @@ def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_build_service_operations.py index eb5a5008093..336c38dbe27 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -532,7 +532,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.BuildService] :raises ~azure.core.exceptions.HttpResponseError: @@ -554,17 +553,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -575,14 +573,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -592,11 +590,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -608,10 +606,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -625,7 +619,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -644,22 +637,21 @@ def get_build_service( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -671,13 +663,9 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -692,7 +680,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -714,18 +701,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -736,14 +722,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -753,11 +739,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -769,10 +755,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -788,7 +770,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -807,23 +788,22 @@ def get_build( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -835,13 +815,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -871,7 +847,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -884,7 +859,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -901,11 +876,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -918,7 +892,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -932,13 +906,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2022_12_01.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2022_12_01.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -966,7 +936,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -976,16 +946,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1005,10 +974,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1024,7 +989,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.BuildResult] :raises ~azure.core.exceptions.HttpResponseError: @@ -1046,19 +1010,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1069,14 +1032,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1086,11 +1049,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1102,10 +1065,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1129,7 +1088,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1148,7 +1106,7 @@ def get_build_result( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1156,16 +1114,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1177,13 +1134,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1208,7 +1161,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1227,7 +1179,7 @@ def get_build_result_log( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1235,16 +1187,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1256,13 +1207,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1277,7 +1224,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1296,22 +1242,21 @@ def get_resource_upload_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1323,13 +1268,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1344,7 +1285,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1363,22 +1303,21 @@ def list_supported_buildpacks( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1390,13 +1329,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1413,7 +1348,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1432,23 +1366,22 @@ def get_supported_buildpack( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1460,13 +1393,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1481,7 +1410,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1500,22 +1428,21 @@ def list_supported_stacks( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1527,13 +1454,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -1550,7 +1473,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1569,23 +1491,22 @@ def get_supported_stack( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1597,10 +1518,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_buildpack_binding_operations.py index 49352957966..b9f8046508b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -243,7 +243,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -262,7 +261,7 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -270,16 +269,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,13 +289,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -306,7 +300,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -332,7 +326,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -343,16 +337,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -372,10 +365,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -408,14 +397,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -451,18 +432,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -478,7 +451,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -495,20 +468,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: ~azure.mgmt.appplatform.v2022_12_01.models.BuildpackBindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -544,7 +506,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -554,17 +516,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -589,7 +549,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -597,16 +557,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -616,11 +575,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -645,14 +600,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -682,7 +629,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -691,17 +638,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -718,7 +661,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -742,19 +684,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -765,14 +706,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -782,11 +723,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -797,7 +738,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_certificates_operations.py index 60bfe970385..83aacc7d6d7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -219,22 +218,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -246,20 +244,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -285,7 +279,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -294,16 +288,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -326,10 +319,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -355,14 +344,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -376,7 +357,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -391,18 +372,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -416,7 +389,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -429,20 +402,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: ~azure.mgmt.appplatform.v2022_12_01.models.CertificateResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -476,7 +438,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -486,17 +448,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -515,22 +475,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -540,11 +499,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -559,14 +514,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -594,7 +541,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -603,17 +550,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -626,7 +569,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.CertificateResource] @@ -649,17 +591,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -670,14 +611,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -687,11 +628,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -702,7 +643,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_config_servers_operations.py index 5c4acc403cd..7a639613779 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -216,21 +215,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -242,19 +240,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -280,7 +274,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -288,16 +282,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -317,10 +310,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -343,14 +332,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +357,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -400,7 +373,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -411,20 +384,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2022_12_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -457,7 +419,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -467,23 +429,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -509,7 +469,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -517,16 +477,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -546,10 +505,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -572,14 +527,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -592,7 +539,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -605,18 +552,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -629,7 +568,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -640,20 +579,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2022_12_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -686,7 +614,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -696,23 +624,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -738,7 +664,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -746,16 +672,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -775,10 +700,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -801,14 +722,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -821,7 +734,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -834,18 +747,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -858,7 +763,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -869,20 +774,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: ~azure.mgmt.appplatform.v2022_12_01.models.ConfigServerSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -915,7 +809,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -927,14 +821,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_configuration_services_operations.py index c40ff595413..429c4dc9375 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -254,22 +253,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -281,20 +279,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -320,7 +314,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -329,16 +323,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -358,10 +351,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -389,14 +378,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -410,7 +391,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -426,18 +407,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -451,7 +424,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -465,20 +438,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2022_12_01.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -512,7 +474,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -522,17 +484,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -551,22 +511,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -576,11 +535,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -595,14 +550,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -630,7 +577,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -639,17 +586,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -662,7 +605,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -686,17 +628,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -707,14 +648,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -724,11 +665,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,16 +681,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -775,7 +712,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -784,16 +721,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -813,10 +749,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -842,14 +774,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -863,7 +787,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -878,18 +802,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -903,7 +819,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -916,19 +832,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. - :type settings: ~azure.mgmt.appplatform.v2022_12_01.models.ConfigurationServiceSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ConfigurationServiceSettings type or a IO[bytes] type. Required. + :type settings: ~azure.mgmt.appplatform.v2022_12_01.models.ConfigurationServiceSettings or + IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -962,7 +868,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -974,14 +880,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_custom_domains_operations.py index 583a5f8262e..556d666904b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -263,23 +262,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,13 +289,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -305,7 +299,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -331,7 +325,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -341,16 +335,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -373,10 +366,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -405,14 +394,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -427,7 +408,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -444,18 +425,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -470,7 +443,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -485,19 +458,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainResource or + IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -532,7 +495,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -542,17 +505,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -571,23 +532,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -597,11 +557,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -618,14 +574,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -654,7 +602,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -663,17 +611,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -681,7 +625,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -707,7 +651,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -717,16 +661,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,10 +689,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -778,14 +717,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -800,7 +731,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -817,18 +748,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -843,7 +766,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -858,19 +781,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainResource or + IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -905,7 +818,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -915,17 +828,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -940,7 +851,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -964,18 +874,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -986,14 +895,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1003,11 +912,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1018,7 +927,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_deployments_operations.py index 08d0f15b868..9c371adc530 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -468,7 +468,7 @@ def build_disable_remote_debugging_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_remote_debugging_config_request( +def build_get_remote_debugging_config_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, app_name: str, @@ -702,7 +702,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -721,23 +720,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -749,13 +747,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -763,7 +757,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -789,7 +783,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -799,16 +793,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -831,10 +824,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -863,14 +852,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -885,7 +866,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -902,18 +883,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -928,7 +901,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -943,19 +916,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2022_12_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + DeploymentResource type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2022_12_01.models.DeploymentResource or + IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -990,7 +953,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1000,17 +963,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1029,23 +990,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1055,11 +1015,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -1076,14 +1032,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1112,7 +1060,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1121,17 +1069,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1139,7 +1083,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1165,7 +1109,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1175,16 +1119,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1204,10 +1147,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1236,14 +1175,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1258,7 +1189,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1275,18 +1206,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1301,7 +1224,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1316,19 +1239,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2022_12_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2022_12_01.models.DeploymentResource or + IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1363,7 +1276,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1373,17 +1286,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1405,7 +1316,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.DeploymentResource] @@ -1428,19 +1338,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1451,14 +1360,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1468,11 +1377,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1484,10 +1393,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1501,7 +1406,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.DeploymentResource] @@ -1524,18 +1428,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1546,14 +1449,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1563,11 +1466,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1579,10 +1482,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1600,23 +1499,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1626,11 +1524,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1647,14 +1541,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1683,7 +1569,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1692,17 +1578,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1721,23 +1603,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1747,11 +1628,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1768,14 +1645,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1804,7 +1673,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1813,17 +1682,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1842,23 +1707,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1868,11 +1732,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1889,14 +1749,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1925,7 +1777,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1934,17 +1786,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_remote_debugging_initial( self, @@ -1952,7 +1800,7 @@ def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -1981,7 +1829,7 @@ def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1991,16 +1839,15 @@ def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2020,10 +1867,6 @@ def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload def begin_enable_remote_debugging( self, @@ -2053,14 +1896,6 @@ def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2075,7 +1910,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2092,18 +1927,10 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2118,7 +1945,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> LROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -2133,20 +1960,9 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2022_12_01.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of LROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -2181,7 +1997,7 @@ def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2191,17 +2007,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2220,23 +2034,22 @@ def _disable_remote_debugging_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2256,10 +2069,6 @@ def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2275,14 +2084,6 @@ def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -2314,7 +2115,7 @@ def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2324,17 +2125,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def get_remote_debugging_config( @@ -2351,7 +2150,6 @@ def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -2370,23 +2168,22 @@ def get_remote_debugging_config( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2398,13 +2195,9 @@ def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace def get_log_file_url( @@ -2421,7 +2214,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -2440,23 +2232,22 @@ def get_log_file_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2470,13 +2261,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2484,7 +2271,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2510,7 +2297,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2520,16 +2307,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2539,11 +2325,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2573,14 +2355,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2593,7 +2367,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2610,18 +2384,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2634,7 +2400,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2649,20 +2415,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2022_12_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -2694,7 +2449,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2703,17 +2458,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2721,7 +2472,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2747,7 +2498,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2757,16 +2508,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2776,11 +2526,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2810,14 +2556,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2830,7 +2568,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2847,18 +2585,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2871,7 +2601,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2886,20 +2616,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2022_12_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -2931,7 +2650,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2940,17 +2659,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2958,7 +2673,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2984,7 +2699,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2994,16 +2709,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -3013,11 +2727,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -3047,14 +2757,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -3067,7 +2769,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -3084,18 +2786,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -3108,7 +2802,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -3123,20 +2817,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2022_12_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -3168,7 +2851,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3177,14 +2860,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_gateway_custom_domains_operations.py index 52c3a411461..a77e79de841 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -242,23 +241,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -270,13 +268,9 @@ def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -284,7 +278,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -310,7 +304,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -320,16 +314,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,10 +342,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -383,14 +372,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -405,7 +386,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -423,18 +404,10 @@ def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -449,7 +422,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -464,20 +437,9 @@ def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2022_12_01.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -512,7 +474,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -522,17 +484,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -551,23 +511,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -577,11 +536,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -598,14 +553,6 @@ def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -634,7 +581,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -643,17 +590,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -668,7 +611,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -692,18 +634,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -714,14 +655,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -731,11 +672,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,7 +687,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_gateway_route_configs_operations.py index 7143b6cc4de..f756dec7034 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -242,23 +241,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -270,13 +268,9 @@ def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -284,7 +278,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -310,7 +304,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -320,16 +314,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,10 +342,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload def begin_create_or_update( self, @@ -384,14 +373,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -406,7 +387,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -425,18 +406,10 @@ def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -451,7 +424,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -467,20 +440,9 @@ def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2022_12_01.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -515,7 +477,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -525,17 +487,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -554,23 +514,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,11 +539,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -601,14 +556,6 @@ def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -637,7 +584,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -646,17 +593,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -671,7 +614,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -695,18 +637,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -717,14 +658,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -734,11 +675,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -749,7 +690,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_gateways_operations.py index 680273a2c51..dd4a7c52cd2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -254,22 +253,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -281,20 +279,16 @@ def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -320,7 +314,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -329,16 +323,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -358,10 +351,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -408,7 +389,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -423,18 +404,10 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -448,7 +421,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -461,19 +434,8 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. - :type gateway_resource: ~azure.mgmt.appplatform.v2022_12_01.models.GatewayResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + GatewayResource type or a IO[bytes] type. Required. + :type gateway_resource: ~azure.mgmt.appplatform.v2022_12_01.models.GatewayResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -507,7 +469,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -517,17 +479,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -546,22 +506,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -571,11 +530,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -590,14 +545,6 @@ def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -625,7 +572,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -634,17 +581,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: @@ -655,7 +598,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.GatewayResource] @@ -678,17 +620,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -699,14 +640,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -716,11 +657,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -732,10 +673,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload def validate_domain( self, @@ -761,7 +698,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -773,7 +709,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -788,11 +724,10 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -804,7 +739,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -817,13 +752,9 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -851,7 +782,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -860,16 +791,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -881,10 +811,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_monitoring_settings_operations.py index d3cca8a7bb9..78937f4fbb7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -182,21 +181,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,19 +206,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -246,7 +240,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -254,16 +248,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,10 +276,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -310,14 +299,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -330,7 +311,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -343,18 +324,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -367,7 +340,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -378,20 +351,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_12_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -424,7 +386,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -434,23 +396,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -476,7 +436,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -484,16 +444,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -513,10 +472,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -540,14 +495,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -560,7 +507,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -573,18 +520,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -597,7 +536,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -608,20 +547,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2022_12_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2022_12_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -654,7 +582,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -664,14 +592,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_operations.py index 77e5ca2e63f..5cb8386e333 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.OperationDetail] @@ -102,14 +101,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -137,11 +135,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -152,5 +150,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_runtime_versions_operations.py index b5f2ea70a53..2a4966fd96b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -96,18 +95,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -119,8 +117,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_service_registries_operations.py index 869d756e41d..2eea86872ca 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -215,22 +214,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -242,13 +240,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -267,22 +261,21 @@ def _create_or_update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -302,10 +295,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -319,14 +308,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -357,7 +338,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -367,17 +348,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -396,22 +375,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +399,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -440,14 +414,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -475,7 +441,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -484,17 +450,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -507,7 +469,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -531,17 +492,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -552,14 +512,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -569,11 +529,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,7 +544,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_services_operations.py index fbec07e0942..938919647b8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -466,7 +466,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -485,21 +484,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -511,16 +509,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -545,7 +543,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -553,16 +551,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,10 +582,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -611,14 +604,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -631,7 +616,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -644,18 +629,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -665,7 +642,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -675,19 +656,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_12_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_12_01.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -720,7 +690,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -730,17 +700,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -759,21 +727,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -783,11 +750,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -798,14 +761,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -832,7 +787,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -841,20 +796,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -879,7 +834,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -887,16 +842,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -916,10 +870,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -942,14 +892,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -962,7 +904,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -975,18 +917,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -996,7 +930,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1005,20 +943,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2022_12_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2022_12_01.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1051,7 +978,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1061,17 +988,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1082,7 +1007,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1101,21 +1025,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1127,13 +1050,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1158,7 +1077,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1169,7 +1087,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1182,11 +1100,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1197,7 +1114,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1208,13 +1125,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2022_12_01.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_12_01.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1242,7 +1155,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1250,16 +1163,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1271,13 +1183,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1290,7 +1198,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1309,21 +1216,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1333,11 +1239,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1348,7 +1250,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1367,21 +1268,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1393,13 +1293,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1418,35 +1314,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1457,14 +1348,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1491,7 +1374,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1500,17 +1383,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1529,35 +1408,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1568,14 +1442,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1602,7 +1468,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1611,17 +1477,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -1642,7 +1504,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1650,18 +1511,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1669,20 +1534,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2022_12_01.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2022_12_01.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1710,23 +1574,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1738,19 +1601,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.ServiceResource] @@ -1773,15 +1631,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1792,14 +1649,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1809,11 +1666,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1825,8 +1682,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1834,7 +1689,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.ServiceResource] @@ -1857,16 +1711,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1877,14 +1730,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1894,11 +1747,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1909,7 +1762,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_skus_operations.py index 09565d56ef6..27305236ad5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.ResourceSku] :raises ~azure.core.exceptions.HttpResponseError: @@ -106,15 +105,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -125,14 +123,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -142,11 +140,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,5 +155,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_storages_operations.py index 67991ea18a2..f407836dc3f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2022_12_01/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2022_12_01.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -219,22 +218,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -246,20 +244,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -285,7 +279,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -294,16 +288,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -326,10 +319,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -355,14 +344,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -376,7 +357,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -391,18 +372,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -416,7 +389,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -429,19 +402,8 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. - :type storage_resource: ~azure.mgmt.appplatform.v2022_12_01.models.StorageResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + StorageResource type or a IO[bytes] type. Required. + :type storage_resource: ~azure.mgmt.appplatform.v2022_12_01.models.StorageResource or IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -475,7 +437,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -485,17 +447,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -514,22 +474,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -539,11 +498,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -558,14 +513,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -593,7 +540,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -602,17 +549,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -623,7 +566,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2022_12_01.models.StorageResource] @@ -646,17 +588,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -667,14 +608,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -684,11 +625,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -699,7 +640,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/_app_platform_management_client.py index 28b80ab3d5a..f3cdf2e0cd2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -155,7 +157,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -242,7 +262,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2023-01-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -262,7 +282,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/_configuration.py index 15d3744c1ad..e0f0a05edc7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-01-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/_app_platform_management_client.py index 467ab39bc4a..99101cc1906 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -155,7 +157,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -242,7 +262,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2023-01-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -262,7 +284,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/_configuration.py index cf68b7691a6..a2e0e124afd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-01-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_api_portal_custom_domains_operations.py index 2475617ee82..82ab39d5bb2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_api_portals_operations.py index 6fb82dcf72f..f1022f5bbdf 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -365,17 +327,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -396,22 +356,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -440,14 +395,6 @@ async def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -477,7 +424,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -486,17 +433,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -509,7 +452,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.ApiPortalResource] @@ -534,17 +476,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -555,14 +496,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -572,11 +513,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +529,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload async def validate_domain( self, @@ -618,7 +555,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -630,7 +566,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -645,11 +581,10 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -661,7 +596,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -674,13 +609,9 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -710,7 +641,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -719,16 +650,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,10 +670,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_application_accelerators_operations.py index 648bf0ee790..6b441a99eda 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -328,14 +311,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -349,7 +324,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -365,18 +340,10 @@ async def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -390,7 +357,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -403,20 +370,9 @@ async def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -452,7 +408,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -462,17 +418,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -493,22 +447,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -518,11 +471,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -537,14 +486,6 @@ async def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -574,7 +515,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -583,14 +524,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_application_live_views_operations.py index 595848afb05..ae7877d9735 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -581,14 +522,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_apps_operations.py index 5aa9db89a08..a54760d93bf 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,20 +133,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -176,7 +170,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -185,16 +179,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -217,10 +210,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -246,14 +235,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -267,7 +248,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -320,19 +293,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -368,7 +330,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -378,17 +340,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -409,22 +369,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,11 +393,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -453,14 +408,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -490,7 +437,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -499,24 +446,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -544,7 +487,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -553,16 +496,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,10 +524,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -611,14 +549,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -632,7 +562,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -647,18 +577,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -672,7 +594,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -684,20 +606,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -733,7 +644,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -743,17 +654,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -764,7 +673,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.AppResource] @@ -789,17 +697,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -810,14 +717,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -827,11 +734,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -843,10 +750,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -860,7 +763,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -881,22 +783,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -908,20 +809,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -949,7 +846,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -958,16 +855,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -987,10 +883,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -1017,14 +909,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1038,7 +922,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1053,18 +937,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1078,7 +954,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1091,20 +967,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1140,7 +1005,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1150,17 +1015,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1188,7 +1051,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1200,7 +1062,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1215,11 +1077,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1231,7 +1092,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1244,13 +1105,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1280,7 +1137,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1289,16 +1146,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1310,10 +1166,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_bindings_operations.py index b5ca9619597..59d50290669 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -705,20 +627,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.BindingResource] @@ -815,18 +723,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -837,14 +744,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -854,11 +761,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -869,7 +776,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_build_service_agent_pool_operations.py index 462d51f90ce..636b056cbc8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -174,7 +168,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -195,23 +188,22 @@ async def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -223,13 +215,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -237,7 +225,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -265,7 +253,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -275,16 +263,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -304,10 +291,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -337,14 +320,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -359,7 +334,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +351,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -402,7 +369,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -417,20 +384,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -467,7 +423,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -477,14 +433,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_build_service_builder_operations.py index 141787cde21..6180d8f095e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,10 +201,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -240,14 +229,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -262,7 +243,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -279,18 +260,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -305,7 +278,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -320,20 +293,9 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -370,7 +332,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -380,17 +342,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -411,23 +371,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +396,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -458,14 +413,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -496,7 +443,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -505,17 +452,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -530,7 +473,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.BuilderResource] @@ -555,18 +497,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -577,14 +518,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -594,11 +535,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -610,10 +551,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace_async async def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -629,7 +566,6 @@ async def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -650,23 +586,22 @@ async def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -678,10 +613,6 @@ async def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_build_service_operations.py index 4e289014f3c..df57411e69d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildService] @@ -105,17 +104,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -126,14 +124,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -143,11 +141,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -159,10 +157,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -176,7 +170,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -197,22 +190,21 @@ async def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -224,13 +216,9 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -245,7 +233,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.Build] @@ -270,18 +257,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -292,14 +278,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -309,11 +295,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -325,10 +311,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -344,7 +326,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -365,23 +346,22 @@ async def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -393,13 +373,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -429,7 +405,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -442,7 +417,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -459,11 +434,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -476,7 +450,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -490,13 +464,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2023_01_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2023_01_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -526,7 +496,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -536,16 +506,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -565,10 +534,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -584,7 +549,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildResult] @@ -609,19 +573,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -632,14 +595,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -649,11 +612,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -665,10 +628,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -692,7 +651,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -713,7 +671,7 @@ async def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -721,16 +679,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -742,13 +699,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -773,7 +726,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -794,7 +746,7 @@ async def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -802,16 +754,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -823,13 +774,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -844,7 +791,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -865,22 +811,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -892,13 +837,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -913,7 +854,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -934,22 +874,21 @@ async def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -961,13 +900,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -984,7 +919,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1005,23 +939,22 @@ async def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1033,13 +966,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1054,7 +983,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1075,22 +1003,21 @@ async def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1102,13 +1029,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1125,7 +1048,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1146,23 +1068,22 @@ async def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,10 +1095,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_buildpack_binding_operations.py index 08be1bc2bc2..66d763a039b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -100,17 +99,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -121,14 +119,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -138,11 +136,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,10 +152,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,7 +195,7 @@ async def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -210,16 +203,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -231,13 +223,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -246,7 +234,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -274,7 +262,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -285,16 +273,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -314,10 +301,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -351,14 +334,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -374,7 +349,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -394,18 +369,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -421,7 +388,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -438,20 +405,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -489,7 +445,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -499,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -536,7 +490,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -544,16 +498,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -563,11 +516,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -592,14 +541,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -631,7 +572,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -640,17 +581,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -667,7 +604,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -693,19 +629,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -716,14 +651,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -733,11 +668,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -748,7 +683,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_certificates_operations.py index d0aedf62922..5fd57da2ba0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,17 +330,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -399,22 +359,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,11 +383,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -443,14 +398,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -489,17 +436,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -512,7 +455,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.CertificateResource] @@ -537,17 +479,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -558,14 +499,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -575,11 +516,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -590,7 +531,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_config_servers_operations.py index dc43ccedf69..ad03c2f5eb2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -345,23 +307,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -389,7 +349,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -397,16 +357,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,10 +385,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -453,14 +408,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -473,7 +420,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -486,18 +433,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -510,7 +449,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -521,20 +460,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -569,7 +497,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -579,23 +507,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -623,7 +549,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -631,16 +557,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -660,10 +585,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -687,14 +608,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -707,7 +620,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -720,18 +633,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -744,7 +649,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -755,20 +660,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -803,7 +697,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -815,14 +709,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_configuration_services_operations.py index c99b6bc6fe4..da97815988d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -310,20 +283,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -359,7 +321,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -369,17 +331,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -400,22 +360,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -425,11 +384,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -444,14 +399,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -481,7 +428,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -490,17 +437,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -513,7 +456,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -539,17 +481,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -560,14 +501,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -577,11 +518,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,16 +534,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -630,7 +567,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -639,16 +576,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -668,10 +604,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -697,14 +629,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -718,7 +642,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -733,18 +657,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -758,7 +674,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -771,20 +687,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -820,7 +725,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -832,14 +737,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_custom_domains_operations.py index f1ec8a2154c..9fc05eb8f8e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -705,20 +627,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -816,18 +724,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -838,14 +745,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -855,11 +762,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -870,7 +777,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_customized_accelerators_operations.py index bf39ade77f8..ac74faa2bc6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -102,18 +101,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -124,14 +122,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -141,11 +139,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,10 +155,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,23 +195,22 @@ async def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -230,13 +222,9 @@ async def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -244,7 +232,7 @@ async def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -272,7 +260,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -282,16 +270,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -311,10 +298,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -345,14 +328,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -367,7 +342,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -385,18 +360,10 @@ async def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -411,7 +378,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -426,20 +393,9 @@ async def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -476,7 +432,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -486,17 +442,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -522,23 +476,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +501,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -574,14 +523,6 @@ async def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -612,7 +553,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -621,17 +562,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def validate( @@ -662,7 +599,6 @@ async def validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -676,7 +612,7 @@ async def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -693,11 +629,10 @@ async def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -711,7 +646,7 @@ async def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -726,13 +661,9 @@ async def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -763,7 +694,7 @@ async def validate( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -773,16 +704,15 @@ async def validate( content_type=content_type, json=_json, content=_content, - template_url=self.validate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -796,10 +726,6 @@ async def validate( deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_deployments_operations.py index b334e48c7f9..ce1f44afddc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -89,7 +89,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -110,23 +109,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -138,13 +136,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -152,7 +146,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -180,7 +174,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -190,16 +184,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -222,10 +215,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -255,14 +244,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -277,7 +258,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -294,18 +275,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -320,7 +293,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -335,20 +308,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -385,7 +347,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -395,17 +357,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -426,23 +386,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -452,11 +411,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -473,14 +428,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -511,7 +458,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -520,17 +467,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -538,7 +481,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -566,7 +509,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -576,16 +519,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -605,10 +547,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -638,14 +576,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -660,7 +590,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -677,18 +607,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -703,7 +625,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -718,20 +640,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -768,7 +679,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -778,17 +689,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -810,7 +719,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentResource] @@ -835,19 +743,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -858,14 +765,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -875,11 +782,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -891,10 +798,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -908,7 +811,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentResource] @@ -933,18 +835,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -955,14 +856,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -972,11 +873,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -988,10 +889,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1011,23 +908,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1037,11 +933,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1058,14 +950,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1096,7 +980,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1105,17 +989,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1136,23 +1016,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1162,11 +1041,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1183,14 +1058,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1221,7 +1088,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1230,17 +1097,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1261,23 +1124,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1287,11 +1149,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1308,14 +1166,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1346,7 +1196,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1355,17 +1205,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_remote_debugging_initial( self, @@ -1373,7 +1219,7 @@ async def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -1404,7 +1250,7 @@ async def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1414,16 +1260,15 @@ async def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1443,10 +1288,6 @@ async def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload async def begin_enable_remote_debugging( self, @@ -1476,14 +1317,6 @@ async def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1498,7 +1331,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1515,18 +1348,10 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1541,7 +1366,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> AsyncLROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -1556,20 +1381,9 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -1606,7 +1420,7 @@ async def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1616,17 +1430,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1647,23 +1459,22 @@ async def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1683,10 +1494,6 @@ async def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace_async async def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1702,14 +1509,6 @@ async def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -1743,7 +1542,7 @@ async def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1753,17 +1552,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def get_remote_debugging_config( @@ -1780,7 +1577,6 @@ async def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -1801,23 +1597,22 @@ async def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1829,13 +1624,9 @@ async def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1852,7 +1643,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1873,23 +1663,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1903,13 +1692,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1917,7 +1702,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1945,7 +1730,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1955,16 +1740,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1974,11 +1758,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -2009,14 +1789,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2029,7 +1801,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2046,18 +1818,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2070,7 +1834,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -2085,20 +1849,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2132,7 +1885,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2141,17 +1894,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2159,7 +1908,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2187,7 +1936,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2197,16 +1946,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2216,11 +1964,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -2251,14 +1995,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2271,7 +2007,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2288,18 +2024,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2312,7 +2040,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -2327,20 +2055,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2374,7 +2091,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2383,17 +2100,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2401,7 +2114,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2429,7 +2142,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2439,16 +2152,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2458,11 +2170,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2493,14 +2201,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2513,7 +2213,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2530,18 +2230,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2554,7 +2246,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2569,20 +2261,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2616,7 +2297,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2625,14 +2306,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_dev_tool_portals_operations.py index 4248e3f77f4..87beccba39b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -581,14 +522,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_gateway_custom_domains_operations.py index fe7d6466c28..029040429dc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_gateway_route_configs_operations.py index a910f4129fe..3f5717566bf 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -264,7 +245,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -283,18 +264,10 @@ async def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -309,7 +282,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -325,20 +298,9 @@ async def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -375,7 +337,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -385,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -416,23 +376,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +401,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +418,6 @@ async def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -501,7 +448,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -510,17 +457,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -535,7 +478,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -561,18 +503,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -583,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -600,11 +541,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -615,7 +556,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_gateways_operations.py index 42d2fd71a78..61ea81ee937 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,22 +98,21 @@ async def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,20 +124,16 @@ async def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -167,7 +161,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -176,16 +170,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -270,18 +251,10 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -295,7 +268,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -308,20 +281,9 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -357,7 +319,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -367,24 +329,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_capacity_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> Optional[_models.GatewayResource]: error_map = { @@ -412,7 +372,7 @@ async def _update_capacity_initial( else: _json = self._serialize.body(gateway_capacity_resource, "SkuObject") - request = build_update_capacity_request( + _request = build_update_capacity_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -421,16 +381,15 @@ async def _update_capacity_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_capacity_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -448,13 +407,9 @@ async def _update_capacity_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_capacity_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore @overload async def begin_update_capacity( @@ -481,14 +436,6 @@ async def begin_update_capacity( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -502,7 +449,7 @@ async def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: IO, + gateway_capacity_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -517,18 +464,10 @@ async def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Required. - :type gateway_capacity_resource: IO + :type gateway_capacity_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -542,7 +481,7 @@ async def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Operation to update an exiting Spring Cloud Gateway capacity. @@ -555,20 +494,9 @@ async def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a - SkuObject type or a IO type. Required. + SkuObject type or a IO[bytes] type. Required. :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.SkuObject - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -604,7 +532,7 @@ async def begin_update_capacity( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -616,17 +544,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_capacity.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -647,22 +573,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -672,11 +597,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -691,14 +612,6 @@ async def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -728,7 +641,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -737,17 +650,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_env_secrets( @@ -762,7 +671,6 @@ async def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -783,22 +691,21 @@ async def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -810,13 +717,9 @@ async def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore @distributed_trace def list( @@ -829,7 +732,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayResource] @@ -854,17 +756,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -875,14 +776,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -892,11 +793,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -908,10 +809,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload async def validate_domain( self, @@ -938,7 +835,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -950,7 +846,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -965,11 +861,10 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -981,7 +876,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -994,13 +889,9 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1030,7 +921,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1039,16 +930,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1060,10 +950,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_monitoring_settings_operations.py index 9a52b974730..fe6cf5644d3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -346,23 +308,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -390,7 +350,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -398,16 +358,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,10 +386,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -454,14 +409,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -474,7 +421,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -487,18 +434,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -511,7 +450,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -522,20 +461,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +498,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -580,14 +508,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_operations.py index 03832d0ffb0..c7fca9e9b2e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_predefined_accelerators_operations.py index ec24904b463..0beb80d0fd5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace_async async def get( self, @@ -179,7 +173,6 @@ async def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -200,23 +193,22 @@ async def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,13 +220,9 @@ async def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore async def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -260,23 +248,22 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -286,11 +273,7 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_disable( @@ -312,14 +295,6 @@ async def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -350,7 +325,7 @@ async def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -359,17 +334,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -395,23 +366,22 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +391,7 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_enable( @@ -447,14 +413,6 @@ async def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -485,7 +443,7 @@ async def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -494,14 +452,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_runtime_versions_operations.py index c6fa1c0e492..d9621568331 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_service_registries_operations.py index a5fc7351c69..b40630d3237 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,13 +120,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -149,22 +143,21 @@ async def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -184,10 +177,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -201,14 +190,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -241,7 +222,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -251,17 +232,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -282,22 +261,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,11 +285,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -326,14 +300,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -363,7 +329,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -372,17 +338,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -395,7 +357,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -421,17 +382,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -442,14 +402,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -459,11 +419,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -474,7 +434,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_services_operations.py index 56c1dc2679d..348f411bac5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -101,21 +100,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,16 +125,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -163,7 +161,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -171,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -229,14 +222,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -249,7 +234,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -262,18 +247,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -283,7 +260,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -293,19 +274,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -340,7 +310,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -350,17 +320,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -381,21 +349,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -405,11 +372,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -420,14 +383,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -456,7 +411,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -465,20 +420,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -505,7 +460,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -513,16 +468,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -542,10 +496,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -568,14 +518,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -588,7 +530,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -601,18 +543,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -622,7 +556,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -631,20 +569,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -679,7 +606,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -689,17 +616,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -710,7 +635,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -731,21 +655,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -757,13 +680,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -788,7 +707,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -799,7 +717,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -812,11 +730,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -827,7 +744,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -838,13 +755,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_01_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -874,7 +787,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -882,16 +795,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -903,13 +815,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -922,7 +830,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -943,21 +850,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -967,11 +873,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -984,7 +886,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1005,21 +906,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1031,13 +931,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1058,35 +954,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1097,14 +988,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1133,7 +1016,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1142,17 +1025,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1173,35 +1052,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1212,14 +1086,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1248,7 +1114,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1257,17 +1123,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -1288,7 +1150,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1296,18 +1157,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1315,20 +1180,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_01_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1358,23 +1222,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1386,19 +1249,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceResource] @@ -1423,15 +1281,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1442,14 +1299,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1459,11 +1316,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1475,8 +1332,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1484,7 +1339,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceResource] @@ -1509,16 +1363,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1529,14 +1382,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1546,11 +1399,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1561,7 +1414,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_skus_operations.py index 4b2042ce6bc..64143ed6db7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_storages_operations.py index 00202f258c8..ac104cf4e9b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -270,18 +251,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -295,7 +268,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -308,20 +281,9 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -357,7 +319,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -367,17 +329,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -398,22 +358,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -423,11 +382,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -442,14 +397,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -479,7 +426,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -488,17 +435,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -511,7 +454,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.StorageResource] @@ -536,17 +478,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -557,14 +498,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -574,11 +515,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,7 +530,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/models/_models_py3.py index 90752d078e5..df2e163a0c3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/models/_models_py3.py @@ -30,7 +30,7 @@ class AcceleratorAuthSetting(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AcceleratorBasicAuthSetting, AcceleratorPublicSetting, AcceleratorSshSetting - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -61,7 +61,7 @@ def __init__(self, **kwargs: Any) -> None: class AcceleratorBasicAuthSetting(AcceleratorAuthSetting): """Auth setting for basic auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -98,7 +98,7 @@ def __init__(self, *, username: str, password: Optional[str] = None, **kwargs: A class AcceleratorGitRepository(_serialization.Model): """AcceleratorGitRepository. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: Git repository URL for the accelerator. Required. :vartype url: str @@ -167,7 +167,7 @@ def __init__( class AcceleratorPublicSetting(AcceleratorAuthSetting): """Auth setting for public url. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -190,7 +190,7 @@ def __init__(self, **kwargs: Any) -> None: class AcceleratorSshSetting(AcceleratorAuthSetting): """Auth setting for SSH auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -330,24 +330,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2023_01_01_preview.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class ApiPortalCustomDomainResource(ProxyResource): """Custom domain of the API portal. @@ -1421,7 +1403,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -1483,7 +1465,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -2351,7 +2333,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2389,7 +2371,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2768,7 +2750,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3064,7 +3046,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -3363,7 +3345,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -3400,7 +3382,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -3712,7 +3694,7 @@ def __init__( self.git_property = git_property -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -3767,7 +3749,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3899,7 +3881,7 @@ def __init__( class CustomContainerUserSourceInfo(UserSourceInfo): """Custom container user source info. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4057,7 +4039,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -4111,7 +4093,7 @@ class CustomizedAcceleratorProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar provisioning_state: State of the customized accelerator. Known values are: "Creating", "Updating", "Succeeded", "Failed", and "Deleting". @@ -4304,7 +4286,7 @@ def __init__( class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -5157,7 +5139,7 @@ class ProbeAction(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ExecAction, HTTPGetAction, TCPSocketAction - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -5185,7 +5167,7 @@ def __init__(self, **kwargs: Any) -> None: class ExecAction(ProbeAction): """ExecAction describes a "run in container" action. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -6083,7 +6065,7 @@ def __init__( class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -6185,7 +6167,7 @@ def __init__( class HTTPGetAction(ProbeAction): """HTTPGetAction describes an action based on HTTP Get requests. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -6413,7 +6395,7 @@ class UploadedUserSourceInfo(UserSourceInfo): You probably want to use the sub-classes and not this class directly. Known sub-classes are: JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -6456,7 +6438,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -6512,7 +6494,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -6606,7 +6588,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -6640,7 +6622,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -7094,7 +7076,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -7127,7 +7109,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7612,7 +7594,7 @@ class Probe(_serialization.Model): """Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive traffic. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar probe_action: The action of the probe. :vartype probe_action: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ProbeAction @@ -7733,7 +7715,7 @@ def __init__( class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2023_01_01_preview.models.TestKeyType @@ -8766,7 +8748,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -8840,7 +8822,7 @@ def __init__(self, *, sku: Optional["_models.Sku"] = None, **kwargs: Any) -> Non class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -8981,7 +8963,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2023_01_01_preview.models.StorageType @@ -9006,7 +8988,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2023_01_01_preview.models.StorageType @@ -9467,7 +9449,7 @@ def __init__( class TCPSocketAction(ProbeAction): """TCPSocketAction describes an action based on opening a socket. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_api_portal_custom_domains_operations.py index 2c7b31d0013..be3bbceb0cc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_api_portals_operations.py index eb933edfee7..faac7cb5e3f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -465,20 +438,9 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -524,17 +486,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -555,22 +515,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,11 +539,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -599,14 +554,6 @@ def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -636,7 +583,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,17 +592,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: @@ -666,7 +609,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.ApiPortalResource] @@ -691,17 +633,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -712,14 +653,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -729,11 +670,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -745,10 +686,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload def validate_domain( self, @@ -775,7 +712,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -787,7 +723,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -802,11 +738,10 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -818,7 +753,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -831,13 +766,9 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -867,7 +798,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -876,16 +807,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +827,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_application_accelerators_operations.py index 9834ff86502..c6cc72705fb 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -204,7 +204,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -230,17 +229,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -251,14 +249,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -268,11 +266,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -284,10 +282,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -301,7 +295,6 @@ def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -322,22 +315,21 @@ def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,20 +341,16 @@ def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -390,7 +378,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -399,16 +387,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,10 +415,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -459,14 +442,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -480,7 +455,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -496,18 +471,10 @@ def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -521,7 +488,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -534,20 +501,9 @@ def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -583,7 +539,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -593,17 +549,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -624,22 +578,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -649,11 +602,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -668,14 +617,6 @@ def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -705,7 +646,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -714,14 +655,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_application_live_views_operations.py index 4f1e9bf6811..4ee410a227d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -198,7 +198,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -224,17 +223,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -245,14 +243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -262,11 +260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -278,10 +276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -295,7 +289,6 @@ def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -316,22 +309,21 @@ def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,20 +335,16 @@ def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -526,20 +493,9 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -616,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_apps_operations.py index 3aed0b9ba61..899d0e6fed6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -373,23 +372,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -401,20 +399,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -442,7 +436,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -451,16 +445,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -483,10 +476,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -512,14 +501,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -533,7 +514,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -548,18 +529,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -573,7 +546,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -586,19 +559,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -634,7 +596,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -644,17 +606,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -675,22 +635,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -700,11 +659,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -719,14 +674,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -756,7 +703,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -765,24 +712,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -810,7 +753,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -819,16 +762,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -848,10 +790,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -877,14 +815,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -898,7 +828,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -913,18 +843,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -938,7 +860,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -950,20 +872,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -999,7 +910,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1009,17 +920,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1030,7 +939,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.AppResource] @@ -1055,17 +963,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1076,14 +983,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1093,11 +1000,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1109,10 +1016,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1126,7 +1029,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1147,22 +1049,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,20 +1075,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1215,7 +1112,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1224,16 +1121,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1253,10 +1149,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1283,14 +1175,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1304,7 +1188,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1319,18 +1203,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1344,7 +1220,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1357,20 +1233,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1406,7 +1271,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1416,17 +1281,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1454,7 +1317,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1466,7 +1328,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1481,11 +1343,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1497,7 +1358,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1510,13 +1371,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1546,7 +1403,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1555,16 +1412,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,10 +1432,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_bindings_operations.py index 9ab7b318f83..52ff96cca66 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -871,20 +793,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.BindingResource] @@ -981,18 +889,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +910,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1020,11 +927,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1035,7 +942,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_build_service_agent_pool_operations.py index 642cacdb8e0..ea35bfd5d3f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -209,18 +208,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -231,14 +229,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -248,11 +246,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -264,10 +262,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -283,7 +277,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -304,23 +297,22 @@ def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -332,13 +324,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -346,7 +334,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -374,7 +362,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -384,16 +372,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -413,10 +400,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -446,14 +429,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -468,7 +443,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -485,18 +460,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -511,7 +478,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -526,20 +493,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -576,7 +532,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +542,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_build_service_builder_operations.py index d59525ff4fd..60aa119cdda 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -261,7 +261,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -282,23 +281,22 @@ def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -310,13 +308,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -324,7 +318,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -352,7 +346,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -362,16 +356,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -391,10 +384,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -423,14 +412,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -445,7 +426,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -462,18 +443,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -488,7 +461,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -503,20 +476,9 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -553,7 +515,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -563,17 +525,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -594,23 +554,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -620,11 +579,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -641,14 +596,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -679,7 +626,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -688,17 +635,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -713,7 +656,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.BuilderResource] @@ -738,18 +680,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -760,14 +701,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -777,11 +718,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,10 +734,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -812,7 +749,6 @@ def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -833,23 +769,22 @@ def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -861,10 +796,6 @@ def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_build_service_operations.py index 2929365f56a..2551f8be7f2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -532,7 +532,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildService] @@ -557,17 +556,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -578,14 +576,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -595,11 +593,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -611,10 +609,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -628,7 +622,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -649,22 +642,21 @@ def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -676,13 +668,9 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore @distributed_trace def list_builds( @@ -697,7 +685,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -721,18 +708,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -743,14 +729,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -760,11 +746,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -776,10 +762,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -795,7 +777,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -816,23 +797,22 @@ def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -844,13 +824,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -880,7 +856,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -893,7 +868,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -910,11 +885,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -927,7 +901,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -941,13 +915,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2023_01_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2023_01_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -977,7 +947,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -987,16 +957,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1016,10 +985,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - @distributed_trace def list_build_results( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1035,7 +1000,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildResult] @@ -1060,19 +1024,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1083,14 +1046,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1100,11 +1063,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1116,10 +1079,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1143,7 +1102,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1164,7 +1122,7 @@ def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1172,16 +1130,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1193,13 +1150,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1224,7 +1177,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1245,7 +1197,7 @@ def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1253,16 +1205,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1274,13 +1225,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1295,7 +1242,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1316,22 +1262,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1343,13 +1288,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1364,7 +1305,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1385,22 +1325,21 @@ def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1412,13 +1351,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1435,7 +1370,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1456,23 +1390,22 @@ def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1484,13 +1417,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1505,7 +1434,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1526,22 +1454,21 @@ def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1553,13 +1480,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -1576,7 +1499,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1597,23 +1519,22 @@ def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1625,10 +1546,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_buildpack_binding_operations.py index a494981f570..e0a3bf87e1b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -262,7 +262,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -288,17 +287,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -309,14 +307,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -326,11 +324,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -342,10 +340,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace def get( self, @@ -369,7 +363,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -390,7 +383,7 @@ def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -398,16 +391,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -419,13 +411,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -434,7 +422,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -462,7 +450,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -473,16 +461,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -502,10 +489,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -539,14 +522,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -562,7 +537,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -582,18 +557,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -609,7 +576,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -626,20 +593,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -677,7 +633,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -687,17 +643,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -724,7 +678,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -732,16 +686,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,11 +704,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -780,14 +729,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -819,7 +760,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -828,17 +769,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -855,7 +792,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -881,19 +817,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -904,14 +839,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -921,11 +856,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -936,7 +871,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_certificates_operations.py index d4fefd2ac38..5a61ee759cc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -493,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -524,22 +484,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -549,11 +508,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -568,14 +523,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -605,7 +552,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -614,17 +561,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -637,7 +580,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.CertificateResource] @@ -662,17 +604,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -683,14 +624,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -700,11 +641,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -715,7 +656,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_config_servers_operations.py index ad184beab8d..e0521b7a468 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -474,23 +436,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -518,7 +478,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -526,16 +486,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,10 +514,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -582,14 +537,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -602,7 +549,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -615,18 +562,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -639,7 +578,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -650,20 +589,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -698,7 +626,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -708,23 +636,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -752,7 +678,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -760,16 +686,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -789,10 +714,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -816,14 +737,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -836,7 +749,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -849,18 +762,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -873,7 +778,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -884,20 +789,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -932,7 +826,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -944,14 +838,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_configuration_services_operations.py index 824c61eec4a..3a98cff972c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -393,14 +382,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -414,7 +395,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -430,18 +411,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -469,20 +442,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -559,22 +519,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,11 +543,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -603,14 +558,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -640,7 +587,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -649,17 +596,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -672,7 +615,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -698,17 +640,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -719,14 +660,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -736,11 +677,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -752,16 +693,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -789,7 +726,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -798,16 +735,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -827,10 +763,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -856,14 +788,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -877,7 +801,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -892,18 +816,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -917,7 +833,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -930,20 +846,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -979,7 +884,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -991,14 +896,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_custom_domains_operations.py index fbb91d74358..85b1704a316 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -871,20 +793,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -982,18 +890,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1004,14 +911,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1021,11 +928,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,7 +943,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_customized_accelerators_operations.py index 2aebcc27a4b..0efca4078a5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -272,7 +272,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -298,18 +297,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -320,14 +318,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -337,11 +335,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +351,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace def get( self, @@ -377,7 +371,6 @@ def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -398,23 +391,22 @@ def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,13 +418,9 @@ def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -440,7 +428,7 @@ def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -468,7 +456,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -478,16 +466,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -507,10 +494,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -541,14 +524,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -563,7 +538,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +556,10 @@ def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -607,7 +574,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -622,20 +589,9 @@ def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -672,7 +628,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -682,17 +638,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -718,23 +672,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -744,11 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -770,14 +719,6 @@ def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -808,7 +749,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -817,17 +758,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def validate( @@ -858,7 +795,6 @@ def validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -872,7 +808,7 @@ def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -889,11 +825,10 @@ def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -907,7 +842,7 @@ def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -922,13 +857,9 @@ def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -959,7 +890,7 @@ def validate( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -969,16 +900,15 @@ def validate( content_type=content_type, json=_json, content=_content, - template_url=self.validate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -992,10 +922,6 @@ def validate( deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_deployments_operations.py index a911b0a1033..c6cb3ee004e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -468,7 +468,7 @@ def build_disable_remote_debugging_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_remote_debugging_config_request( +def build_get_remote_debugging_config_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, app_name: str, @@ -702,7 +702,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -723,23 +722,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,13 +749,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -765,7 +759,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -793,7 +787,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -803,16 +797,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -835,10 +828,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -868,14 +857,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -890,7 +871,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -907,18 +888,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -933,7 +906,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -948,20 +921,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -998,7 +960,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1008,17 +970,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1039,23 +999,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1065,11 +1024,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -1086,14 +1041,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1124,7 +1071,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1133,17 +1080,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1151,7 +1094,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1179,7 +1122,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1189,16 +1132,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1218,10 +1160,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1251,14 +1189,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1273,7 +1203,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1290,18 +1220,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1316,7 +1238,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1331,20 +1253,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1381,7 +1292,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1391,17 +1302,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1423,7 +1332,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentResource] @@ -1448,19 +1356,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1471,14 +1378,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1488,11 +1395,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1504,10 +1411,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1521,7 +1424,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.DeploymentResource] @@ -1546,18 +1448,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1568,14 +1469,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1585,11 +1486,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1601,10 +1502,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1624,23 +1521,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1650,11 +1546,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1671,14 +1563,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1709,7 +1593,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1718,17 +1602,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1749,23 +1629,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1775,11 +1654,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1796,14 +1671,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1834,7 +1701,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1843,17 +1710,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1874,23 +1737,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1900,11 +1762,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1921,14 +1779,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1959,7 +1809,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1968,17 +1818,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_remote_debugging_initial( self, @@ -1986,7 +1832,7 @@ def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -2017,7 +1863,7 @@ def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2027,16 +1873,15 @@ def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2056,10 +1901,6 @@ def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload def begin_enable_remote_debugging( self, @@ -2089,14 +1930,6 @@ def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2111,7 +1944,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2128,18 +1961,10 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2154,7 +1979,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> LROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -2169,20 +1994,9 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of LROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -2219,7 +2033,7 @@ def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2229,17 +2043,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2260,23 +2072,22 @@ def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2296,10 +2107,6 @@ def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2315,14 +2122,6 @@ def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -2356,7 +2155,7 @@ def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2366,17 +2165,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def get_remote_debugging_config( @@ -2393,7 +2190,6 @@ def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -2414,23 +2210,22 @@ def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2442,13 +2237,9 @@ def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace def get_log_file_url( @@ -2465,7 +2256,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -2486,23 +2276,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2516,13 +2305,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2530,7 +2315,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2558,7 +2343,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2568,16 +2353,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2587,11 +2371,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2622,14 +2402,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2642,7 +2414,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2659,18 +2431,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2683,7 +2447,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2698,20 +2462,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2745,7 +2498,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2754,17 +2507,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2772,7 +2521,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2800,7 +2549,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2810,16 +2559,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2829,11 +2577,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2864,14 +2608,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2884,7 +2620,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2901,18 +2637,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2925,7 +2653,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2940,20 +2668,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2987,7 +2704,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2996,17 +2713,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -3014,7 +2727,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -3042,7 +2755,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -3052,16 +2765,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -3071,11 +2783,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -3106,14 +2814,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -3126,7 +2826,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -3143,18 +2843,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -3167,7 +2859,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -3182,20 +2874,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -3229,7 +2910,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3238,14 +2919,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_dev_tool_portals_operations.py index 8e729e748e8..52bc1d8c15c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -198,7 +198,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -224,17 +223,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -245,14 +243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -262,11 +260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -278,10 +276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -295,7 +289,6 @@ def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -316,22 +309,21 @@ def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,20 +335,16 @@ def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -526,20 +493,9 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of LROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -616,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_gateway_custom_domains_operations.py index 15bfc326d49..094d16907b2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_gateway_route_configs_operations.py index be2d8d63ee8..b9d1586e3e3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload def begin_create_or_update( self, @@ -388,14 +377,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -410,7 +391,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -429,18 +410,10 @@ def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -471,20 +444,9 @@ def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -521,7 +483,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -531,17 +493,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -562,23 +522,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,11 +547,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -609,14 +564,6 @@ def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -647,7 +594,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -656,17 +603,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -681,7 +624,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -707,18 +649,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -729,14 +670,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -746,11 +687,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -761,7 +702,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_gateways_operations.py index 1b709dc82db..240c65a0e46 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -302,7 +302,6 @@ def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -323,22 +322,21 @@ def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -350,20 +348,16 @@ def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -391,7 +385,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -400,16 +394,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,10 +422,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload def begin_create_or_update( self, @@ -458,14 +447,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -479,7 +460,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -494,18 +475,10 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -519,7 +492,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -532,20 +505,9 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -581,7 +543,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -591,24 +553,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_capacity_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> Optional[_models.GatewayResource]: error_map = { @@ -636,7 +596,7 @@ def _update_capacity_initial( else: _json = self._serialize.body(gateway_capacity_resource, "SkuObject") - request = build_update_capacity_request( + _request = build_update_capacity_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -645,16 +605,15 @@ def _update_capacity_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_capacity_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -672,13 +631,9 @@ def _update_capacity_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - _update_capacity_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore @overload def begin_update_capacity( @@ -705,14 +660,6 @@ def begin_update_capacity( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -726,7 +673,7 @@ def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: IO, + gateway_capacity_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -741,18 +688,10 @@ def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Required. - :type gateway_capacity_resource: IO + :type gateway_capacity_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -766,7 +705,7 @@ def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Operation to update an exiting Spring Cloud Gateway capacity. @@ -779,20 +718,9 @@ def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a - SkuObject type or a IO type. Required. + SkuObject type or a IO[bytes] type. Required. :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.SkuObject - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -828,7 +756,7 @@ def begin_update_capacity( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -840,17 +768,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_capacity.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -871,22 +797,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -896,11 +821,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -915,14 +836,6 @@ def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -952,7 +865,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -961,17 +874,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_env_secrets( @@ -986,7 +895,6 @@ def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -1007,22 +915,21 @@ def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1034,13 +941,9 @@ def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: @@ -1051,7 +954,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.GatewayResource] @@ -1076,17 +978,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1097,14 +998,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -1114,11 +1015,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1130,10 +1031,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload def validate_domain( self, @@ -1160,7 +1057,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1172,7 +1068,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1187,11 +1083,10 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1203,7 +1098,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -1216,13 +1111,9 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1252,7 +1143,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1261,16 +1152,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1282,10 +1172,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_monitoring_settings_operations.py index 5f59f2b39cd..2f0239f2835 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -440,23 +402,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -484,7 +444,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -492,16 +452,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -521,10 +480,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -548,14 +503,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -568,7 +515,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +528,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -605,7 +544,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -616,20 +555,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_01_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -664,7 +592,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -674,14 +602,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_operations.py index 9aa8eb84e04..134b18e6522 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_predefined_accelerators_operations.py index 24944ec3095..42cd56ac68a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -225,7 +225,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -251,18 +250,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -273,14 +271,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -290,11 +288,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +304,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace def get( self, @@ -330,7 +324,6 @@ def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -351,23 +344,22 @@ def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -379,13 +371,9 @@ def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -411,23 +399,22 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +424,7 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_disable( @@ -463,14 +446,6 @@ def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -501,7 +476,7 @@ def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -510,17 +485,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -546,23 +517,22 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -572,11 +542,7 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_enable( @@ -598,14 +564,6 @@ def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -636,7 +594,7 @@ def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,14 +603,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_runtime_versions_operations.py index 131bbdb701a..287da6a6052 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_service_registries_operations.py index 02e8815f856..0dace07dadf 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -217,22 +216,21 @@ def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,13 +242,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -271,22 +265,21 @@ def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +299,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -323,14 +312,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -373,17 +354,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -404,22 +383,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,11 +407,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -448,14 +422,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -485,7 +451,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -494,17 +460,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -517,7 +479,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -543,17 +504,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -581,11 +541,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +556,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_services_operations.py index b16ea6a9da7..976ef6eafbf 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -466,7 +466,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -487,21 +486,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -513,16 +511,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -549,7 +547,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -557,16 +555,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,10 +586,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -615,14 +608,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -635,7 +620,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -648,18 +633,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -669,7 +646,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -679,19 +660,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -726,7 +696,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -736,17 +706,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -767,21 +735,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -791,11 +758,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -806,14 +769,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -842,7 +797,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -851,20 +806,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -891,7 +846,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -899,16 +854,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -928,10 +882,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -954,14 +904,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -974,7 +916,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -987,18 +929,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1008,7 +942,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1017,20 +955,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1065,7 +992,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1075,17 +1002,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1096,7 +1021,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1117,21 +1041,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1143,13 +1066,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1174,7 +1093,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1185,7 +1103,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1198,11 +1116,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1213,7 +1130,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1224,13 +1141,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_01_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1260,7 +1173,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1268,16 +1181,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1289,13 +1201,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1308,7 +1216,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1329,21 +1236,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1353,11 +1259,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1368,7 +1270,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1389,21 +1290,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1415,13 +1315,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1442,35 +1338,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1481,14 +1372,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1517,7 +1400,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1526,17 +1409,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1557,35 +1436,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1596,14 +1470,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1632,7 +1498,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1641,17 +1507,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -1672,7 +1534,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1680,18 +1541,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1699,20 +1564,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2023_01_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_01_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1742,23 +1606,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1770,19 +1633,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceResource] @@ -1807,15 +1665,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1826,14 +1683,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1843,11 +1700,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1859,8 +1716,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1868,7 +1723,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.ServiceResource] @@ -1893,16 +1747,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1913,14 +1766,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1930,11 +1783,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1945,7 +1798,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_skus_operations.py index 71b05c2e9ce..5092f0f4d12 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_storages_operations.py index 68fb72beaec..46fc3405986 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_01_01_preview/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_01_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -359,14 +348,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -380,7 +361,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -395,18 +376,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -420,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -433,20 +406,9 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2023_01_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -482,7 +444,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -492,17 +454,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -523,22 +483,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +507,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -567,14 +522,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -604,7 +551,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -613,17 +560,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -634,7 +577,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_01_01_preview.models.StorageResource] @@ -659,17 +601,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -680,14 +621,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -697,11 +638,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -712,7 +653,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/_app_platform_management_client.py index e9ef928857a..dda16ddc0c8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -159,7 +161,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -249,7 +269,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2023-03-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -269,7 +289,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/_configuration.py index c638e5698c8..ee12c899484 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-03-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/_app_platform_management_client.py index 1104bb27853..e59fb01b75a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -159,7 +161,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -249,7 +269,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2023-03-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -269,7 +291,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/_configuration.py index adb5e0efe25..fd41aef4b46 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-03-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_api_portal_custom_domains_operations.py index 9f1df4bbfd7..926ba597bdc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_api_portals_operations.py index 9588f03c99e..c7ddf3aff8a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -365,17 +327,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -396,22 +356,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -440,14 +395,6 @@ async def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -477,7 +424,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -486,17 +433,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -509,7 +452,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.ApiPortalResource] @@ -534,17 +476,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -555,14 +496,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -572,11 +513,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +529,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload async def validate_domain( self, @@ -618,7 +555,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -630,7 +566,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -645,11 +581,10 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -661,7 +596,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -674,13 +609,9 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -710,7 +641,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -719,16 +650,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,10 +670,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_application_accelerators_operations.py index c723054e775..bc6901cbb7c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -328,14 +311,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -349,7 +324,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -365,18 +340,10 @@ async def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -390,7 +357,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -403,20 +370,9 @@ async def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -452,7 +408,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -462,17 +418,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -493,22 +447,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -518,11 +471,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -537,14 +486,6 @@ async def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -574,7 +515,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -583,14 +524,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_application_live_views_operations.py index 952ed70b4bb..fe6a4977017 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -581,14 +522,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_apps_operations.py index 9b4fc9535da..6ff7563b85d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,20 +133,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -176,7 +170,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -185,16 +179,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -217,10 +210,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -246,14 +235,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -267,7 +248,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -320,19 +293,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -368,7 +330,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -378,17 +340,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -409,22 +369,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,11 +393,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -453,14 +408,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -490,7 +437,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -499,24 +446,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -544,7 +487,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -553,16 +496,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,10 +524,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -611,14 +549,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -632,7 +562,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -647,18 +577,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -672,7 +594,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -684,20 +606,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -733,7 +644,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -743,17 +654,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -764,7 +673,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.AppResource] @@ -789,17 +697,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -810,14 +717,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -827,11 +734,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -843,10 +750,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -860,7 +763,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -881,22 +783,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -908,20 +809,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -949,7 +846,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -958,16 +855,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -987,10 +883,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -1017,14 +909,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1038,7 +922,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1053,18 +937,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1078,7 +954,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1091,20 +967,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1140,7 +1005,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1150,17 +1015,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1188,7 +1051,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1200,7 +1062,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1215,11 +1077,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1231,7 +1092,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1244,13 +1105,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1280,7 +1137,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1289,16 +1146,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1310,10 +1166,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_bindings_operations.py index 1444df91751..e756e139643 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -705,20 +627,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.BindingResource] @@ -815,18 +723,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -837,14 +744,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -854,11 +761,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -869,7 +776,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_build_service_agent_pool_operations.py index ebdf63250c7..8841107d7f8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -174,7 +168,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -195,23 +188,22 @@ async def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -223,13 +215,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -237,7 +225,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -265,7 +253,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -275,16 +263,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -304,10 +291,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -337,14 +320,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -359,7 +334,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +351,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -402,7 +369,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -417,20 +384,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -467,7 +423,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -477,14 +433,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_build_service_builder_operations.py index 33f3edfb198..541a545683a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,10 +201,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -240,14 +229,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -262,7 +243,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -279,18 +260,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -305,7 +278,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -320,20 +293,9 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -370,7 +332,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -380,17 +342,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -411,23 +371,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +396,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -458,14 +413,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -496,7 +443,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -505,17 +452,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -530,7 +473,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.BuilderResource] @@ -555,18 +497,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -577,14 +518,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -594,11 +535,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -610,10 +551,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace_async async def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -629,7 +566,6 @@ async def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -650,23 +586,22 @@ async def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -678,10 +613,6 @@ async def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_build_service_operations.py index 8dfed690659..59556f25b85 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildService] @@ -109,17 +108,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -130,14 +128,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -147,11 +145,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -163,10 +161,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -180,7 +174,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -201,22 +194,21 @@ async def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,20 +220,16 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> _models.BuildService: error_map = { @@ -269,7 +257,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(build_service, "BuildService") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -278,16 +266,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,10 +294,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } - @overload async def begin_create_or_update( self, @@ -336,14 +319,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -357,7 +332,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: IO, + build_service: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -372,18 +347,10 @@ async def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Required. - :type build_service: IO + :type build_service: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -397,7 +364,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildService]: """Create a build service resource. @@ -410,19 +377,9 @@ async def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Is either a BuildService type or a - IO type. Required. - :type build_service: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildService or + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildService or the result of cls(response) :rtype: @@ -458,7 +415,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -470,17 +427,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildService].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return AsyncLROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_builds( @@ -495,7 +450,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.Build] @@ -520,18 +474,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -542,14 +495,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -559,11 +512,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -575,10 +528,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -594,7 +543,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -615,23 +563,22 @@ async def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -643,13 +590,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -679,7 +622,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -692,7 +634,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -709,11 +651,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -726,7 +667,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -740,13 +681,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2023_03_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2023_03_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -776,7 +713,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -786,16 +723,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -815,10 +751,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - async def _delete_build_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> None: @@ -838,23 +770,22 @@ async def _delete_build_initial( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_build_request( + _request = build_delete_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_build_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -868,11 +799,7 @@ async def _delete_build_initial( # pylint: disable=inconsistent-return-statemen response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_build_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete_build( @@ -889,14 +816,6 @@ async def begin_delete_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_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: @@ -927,7 +846,7 @@ async def begin_delete_build( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -938,17 +857,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_build_results( @@ -965,7 +880,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildResult] @@ -990,19 +904,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1013,14 +926,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1030,11 +943,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1046,10 +959,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -1073,7 +982,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1094,7 +1002,7 @@ async def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1102,16 +1010,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1123,13 +1030,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -1154,7 +1057,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1175,7 +1077,7 @@ async def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1183,16 +1085,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1204,13 +1105,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -1225,7 +1122,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1246,22 +1142,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1273,13 +1168,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -1294,7 +1185,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1315,22 +1205,21 @@ async def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1342,13 +1231,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -1365,7 +1250,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1386,23 +1270,22 @@ async def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1414,13 +1297,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1435,7 +1314,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1456,22 +1334,21 @@ async def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1483,13 +1360,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1506,7 +1379,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1527,23 +1399,22 @@ async def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1555,10 +1426,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_buildpack_binding_operations.py index 3473ef79d06..555c6aae2fe 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -100,17 +99,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -121,14 +119,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -138,11 +136,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,10 +152,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,7 +195,7 @@ async def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -210,16 +203,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -231,13 +223,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -246,7 +234,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -274,7 +262,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -285,16 +273,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -314,10 +301,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -351,14 +334,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -374,7 +349,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -394,18 +369,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -421,7 +388,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -438,20 +405,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -489,7 +445,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -499,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -536,7 +490,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -544,16 +498,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -563,11 +516,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -592,14 +541,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -631,7 +572,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -640,17 +581,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -667,7 +604,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -693,19 +629,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -716,14 +651,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -733,11 +668,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -748,7 +683,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_certificates_operations.py index 2f35e91cf76..fec7d649123 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,17 +330,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -399,22 +359,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,11 +383,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -443,14 +398,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -489,17 +436,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -512,7 +455,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.CertificateResource] @@ -537,17 +479,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -558,14 +499,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -575,11 +516,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -590,7 +531,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_config_servers_operations.py index 40a11ac8d37..3daef9f0f3e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -345,23 +307,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -389,7 +349,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -397,16 +357,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,10 +385,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -453,14 +408,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -473,7 +420,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -486,18 +433,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -510,7 +449,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -521,20 +460,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -569,7 +497,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -579,23 +507,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -623,7 +549,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -631,16 +557,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -660,10 +585,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -687,14 +608,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -707,7 +620,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -720,18 +633,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -744,7 +649,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -755,20 +660,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -803,7 +697,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -815,14 +709,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_configuration_services_operations.py index a8198f0c26d..ea432fc5717 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -310,20 +283,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -359,7 +321,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -369,17 +331,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -400,22 +360,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -425,11 +384,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -444,14 +399,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -481,7 +428,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -490,17 +437,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -513,7 +456,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -539,17 +481,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -560,14 +501,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -577,11 +518,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,16 +534,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -630,7 +567,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -639,16 +576,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -668,10 +604,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -697,14 +629,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -718,7 +642,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -733,18 +657,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -758,7 +674,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -771,20 +687,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -820,7 +725,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -832,14 +737,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_container_registries_operations.py index 266e0cba376..3ce75afd270 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_container_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_container_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -72,7 +72,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContainerRegistryResource or the result of cls(response) :rtype: @@ -98,17 +97,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -119,14 +117,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) @@ -136,11 +134,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -152,10 +150,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -169,7 +163,6 @@ async def get( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ContainerRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -190,22 +183,21 @@ async def get( ) cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -217,20 +209,16 @@ async def get( deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> _models.ContainerRegistryResource: error_map = { @@ -258,7 +246,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -267,16 +255,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -296,10 +283,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } - @overload async def begin_create_or_update( self, @@ -326,14 +309,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -347,7 +322,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: IO, + container_registry_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -362,18 +337,10 @@ async def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Required. - :type container_registry_resource: IO + :type container_registry_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -387,7 +354,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ContainerRegistryResource]: """Create or update container registry resource. @@ -400,20 +367,9 @@ async def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Is either a - ContainerRegistryResource type or a IO type. Required. + ContainerRegistryResource type or a IO[bytes] type. Required. :type container_registry_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ContainerRegistryResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ContainerRegistryResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the result of cls(response) :rtype: @@ -449,7 +405,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -461,14 +417,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ContainerRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return AsyncLROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_custom_domains_operations.py index ed4a42552c1..e5b8dd25f53 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -705,20 +627,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -816,18 +724,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -838,14 +745,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -855,11 +762,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -870,7 +777,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_customized_accelerators_operations.py index a312fac6ffd..4cfba3bf1aa 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -102,18 +101,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -124,14 +122,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -141,11 +139,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,10 +155,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,23 +195,22 @@ async def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -230,13 +222,9 @@ async def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -244,7 +232,7 @@ async def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -272,7 +260,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -282,16 +270,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -311,10 +298,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -345,14 +328,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -367,7 +342,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -385,18 +360,10 @@ async def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -411,7 +378,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -426,20 +393,9 @@ async def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -476,7 +432,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -486,17 +442,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -522,23 +476,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +501,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -574,14 +523,6 @@ async def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -612,7 +553,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -621,17 +562,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def validate( @@ -662,7 +599,6 @@ async def validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -676,7 +612,7 @@ async def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -693,11 +629,10 @@ async def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -711,7 +646,7 @@ async def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -726,13 +661,9 @@ async def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -763,7 +694,7 @@ async def validate( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -773,16 +704,15 @@ async def validate( content_type=content_type, json=_json, content=_content, - template_url=self.validate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -796,10 +726,6 @@ async def validate( deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_deployments_operations.py index 149b0015674..f7f109d7422 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -89,7 +89,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -110,23 +109,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -138,13 +136,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -152,7 +146,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -180,7 +174,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -190,16 +184,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -222,10 +215,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -255,14 +244,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -277,7 +258,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -294,18 +275,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -320,7 +293,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -335,20 +308,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -385,7 +347,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -395,17 +357,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -426,23 +386,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -452,11 +411,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -473,14 +428,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -511,7 +458,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -520,17 +467,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -538,7 +481,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -566,7 +509,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -576,16 +519,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -605,10 +547,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -638,14 +576,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -660,7 +590,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -677,18 +607,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -703,7 +625,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -718,20 +640,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -768,7 +679,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -778,17 +689,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -810,7 +719,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentResource] @@ -835,19 +743,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -858,14 +765,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -875,11 +782,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -891,10 +798,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -908,7 +811,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentResource] @@ -933,18 +835,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -955,14 +856,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -972,11 +873,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -988,10 +889,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1011,23 +908,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1037,11 +933,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1058,14 +950,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1096,7 +980,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1105,17 +989,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1136,23 +1016,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1162,11 +1041,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1183,14 +1058,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1221,7 +1088,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1230,17 +1097,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1261,23 +1124,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1287,11 +1149,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1308,14 +1166,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1346,7 +1196,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1355,17 +1205,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_remote_debugging_initial( self, @@ -1373,7 +1219,7 @@ async def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -1404,7 +1250,7 @@ async def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1414,16 +1260,15 @@ async def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1443,10 +1288,6 @@ async def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload async def begin_enable_remote_debugging( self, @@ -1476,14 +1317,6 @@ async def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1498,7 +1331,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1515,18 +1348,10 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1541,7 +1366,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> AsyncLROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -1556,20 +1381,9 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -1606,7 +1420,7 @@ async def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1616,17 +1430,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1647,23 +1459,22 @@ async def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1683,10 +1494,6 @@ async def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace_async async def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1702,14 +1509,6 @@ async def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -1743,7 +1542,7 @@ async def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1753,17 +1552,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def get_remote_debugging_config( @@ -1780,7 +1577,6 @@ async def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -1801,23 +1597,22 @@ async def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1829,13 +1624,9 @@ async def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1852,7 +1643,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1873,23 +1663,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1903,13 +1692,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1917,7 +1702,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1945,7 +1730,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1955,16 +1740,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1974,11 +1758,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -2009,14 +1789,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2029,7 +1801,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2046,18 +1818,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2070,7 +1834,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -2085,20 +1849,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2132,7 +1885,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2141,17 +1894,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2159,7 +1908,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2187,7 +1936,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2197,16 +1946,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2216,11 +1964,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -2251,14 +1995,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2271,7 +2007,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2288,18 +2024,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2312,7 +2040,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -2327,20 +2055,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2374,7 +2091,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2383,17 +2100,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2401,7 +2114,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2429,7 +2142,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2439,16 +2152,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2458,11 +2170,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2493,14 +2201,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2513,7 +2213,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2530,18 +2230,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2554,7 +2246,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2569,20 +2261,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2616,7 +2297,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2625,14 +2306,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_dev_tool_portals_operations.py index 4b9ebf50059..7181b9b91c7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -581,14 +522,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_gateway_custom_domains_operations.py index ef17597df8e..e464df5b3ad 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_gateway_route_configs_operations.py index 0393dd57d03..3b3d71e82ea 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -264,7 +245,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -283,18 +264,10 @@ async def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -309,7 +282,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -325,20 +298,9 @@ async def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -375,7 +337,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -385,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -416,23 +376,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +401,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +418,6 @@ async def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -501,7 +448,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -510,17 +457,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -535,7 +478,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -561,18 +503,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -583,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -600,11 +541,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -615,7 +556,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_gateways_operations.py index f0c59f65dd9..4b5e7dd8488 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ async def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -100,22 +99,21 @@ async def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,20 +125,16 @@ async def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -177,16 +171,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -206,10 +199,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,24 +330,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_capacity_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> Optional[_models.GatewayResource]: error_map = { @@ -413,7 +373,7 @@ async def _update_capacity_initial( else: _json = self._serialize.body(gateway_capacity_resource, "SkuObject") - request = build_update_capacity_request( + _request = build_update_capacity_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -422,16 +382,15 @@ async def _update_capacity_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_capacity_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,13 +408,9 @@ async def _update_capacity_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_capacity_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore @overload async def begin_update_capacity( @@ -482,14 +437,6 @@ async def begin_update_capacity( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -503,7 +450,7 @@ async def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: IO, + gateway_capacity_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -518,18 +465,10 @@ async def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Required. - :type gateway_capacity_resource: IO + :type gateway_capacity_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -543,7 +482,7 @@ async def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Operation to update an exiting Spring Cloud Gateway capacity. @@ -556,20 +495,9 @@ async def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a - SkuObject type or a IO type. Required. + SkuObject type or a IO[bytes] type. Required. :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.SkuObject - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -605,7 +533,7 @@ async def begin_update_capacity( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -617,17 +545,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_capacity.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -648,22 +574,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -673,11 +598,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -692,14 +613,6 @@ async def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -729,7 +642,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -738,17 +651,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_env_secrets( @@ -763,7 +672,6 @@ async def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -784,22 +692,21 @@ async def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -811,13 +718,9 @@ async def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -838,22 +741,21 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -867,11 +769,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_restart( @@ -886,14 +784,6 @@ async def begin_restart( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -923,7 +813,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -934,17 +824,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -957,7 +843,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayResource] @@ -982,17 +867,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +887,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -1020,11 +904,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,10 +920,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload async def validate_domain( self, @@ -1066,7 +946,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1078,7 +957,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1093,11 +972,10 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1109,7 +987,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -1122,13 +1000,9 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1158,7 +1032,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1167,16 +1041,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1188,10 +1061,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_monitoring_settings_operations.py index 7582cfbb927..37117fd1362 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -346,23 +308,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -390,7 +350,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -398,16 +358,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,10 +386,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -454,14 +409,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -474,7 +421,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -487,18 +434,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -511,7 +450,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -522,20 +461,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +498,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -580,14 +508,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_operations.py index 7244de93e37..d7751240e83 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_predefined_accelerators_operations.py index ee12fde3b3a..da8376b9952 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace_async async def get( self, @@ -179,7 +173,6 @@ async def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -200,23 +193,22 @@ async def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,13 +220,9 @@ async def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore async def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -260,23 +248,22 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -286,11 +273,7 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_disable( @@ -312,14 +295,6 @@ async def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -350,7 +325,7 @@ async def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -359,17 +334,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -395,23 +366,22 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +391,7 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_enable( @@ -447,14 +413,6 @@ async def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -485,7 +443,7 @@ async def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -494,14 +452,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_runtime_versions_operations.py index 690c67bc8f6..24ac37f7a6e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_service_registries_operations.py index 8a4d923e18e..c69bc6a294f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,13 +120,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -149,22 +143,21 @@ async def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -184,10 +177,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -201,14 +190,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -241,7 +222,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -251,17 +232,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -282,22 +261,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,11 +285,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -326,14 +300,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -363,7 +329,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -372,17 +338,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -395,7 +357,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -421,17 +382,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -442,14 +402,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -459,11 +419,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -474,7 +434,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_services_operations.py index 4d810933679..3de8b031073 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -80,7 +80,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -101,21 +100,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,16 +125,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -163,7 +161,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -171,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -229,14 +222,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -249,7 +234,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -262,18 +247,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -283,7 +260,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -293,19 +274,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -340,7 +310,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -350,17 +320,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -381,21 +349,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -405,11 +372,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -420,14 +383,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -456,7 +411,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -465,20 +420,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -505,7 +460,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -513,16 +468,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -542,10 +496,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -568,14 +518,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -588,7 +530,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -601,18 +543,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -622,7 +556,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -631,20 +569,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -679,7 +606,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -689,17 +616,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -710,7 +635,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -731,21 +655,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -757,13 +680,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -788,7 +707,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -799,7 +717,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -812,11 +730,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -827,7 +744,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -838,13 +755,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_03_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -874,7 +787,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -882,16 +795,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -903,13 +815,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -922,7 +830,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -943,21 +850,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -967,11 +873,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -984,7 +886,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1005,21 +906,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1031,13 +931,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1058,35 +954,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1097,14 +988,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1133,7 +1016,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1142,17 +1025,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1173,35 +1052,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1212,14 +1086,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1248,7 +1114,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1257,17 +1123,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -1288,7 +1150,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1296,18 +1157,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1315,20 +1180,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_03_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1358,23 +1222,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1386,19 +1249,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceResource] @@ -1423,15 +1281,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1442,14 +1299,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1459,11 +1316,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1475,8 +1332,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1484,7 +1339,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceResource] @@ -1509,16 +1363,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1529,14 +1382,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1546,11 +1399,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1561,7 +1414,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_skus_operations.py index 531720a7b90..85025626b6a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_storages_operations.py index eee80699855..a4393a742c3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -270,18 +251,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -295,7 +268,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -308,20 +281,9 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -357,7 +319,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -367,17 +329,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -398,22 +358,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -423,11 +382,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -442,14 +397,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -479,7 +426,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -488,17 +435,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -511,7 +454,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.StorageResource] @@ -536,17 +478,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -557,14 +498,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -574,11 +515,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,7 +530,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/models/_models_py3.py index db0b3139a67..b33d8e798dd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/models/_models_py3.py @@ -30,7 +30,7 @@ class AcceleratorAuthSetting(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AcceleratorBasicAuthSetting, AcceleratorPublicSetting, AcceleratorSshSetting - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -61,7 +61,7 @@ def __init__(self, **kwargs: Any) -> None: class AcceleratorBasicAuthSetting(AcceleratorAuthSetting): """Auth setting for basic auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -106,7 +106,7 @@ def __init__( class AcceleratorGitRepository(_serialization.Model): """AcceleratorGitRepository. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: Git repository URL for the accelerator. Required. :vartype url: str @@ -175,7 +175,7 @@ def __init__( class AcceleratorPublicSetting(AcceleratorAuthSetting): """Auth setting for public url. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -205,7 +205,7 @@ def __init__(self, *, ca_cert_resource_id: Optional[str] = None, **kwargs: Any) class AcceleratorSshSetting(AcceleratorAuthSetting): """Auth setting for SSH auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -345,24 +345,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2023_03_01_preview.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class ApiPortalCustomDomainResource(ProxyResource): """Custom domain of the API portal. @@ -1436,7 +1418,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -1498,7 +1480,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -2371,7 +2353,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2409,7 +2391,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2794,7 +2776,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3090,7 +3072,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -3389,7 +3371,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -3426,7 +3408,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -3738,7 +3720,7 @@ def __init__( self.git_property = git_property -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -3794,7 +3776,7 @@ class ContainerRegistryCredentials(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ContainerRegistryBasicCredentials - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The credential type of the container registry credentials. Required. :vartype type: str @@ -3819,7 +3801,7 @@ def __init__(self, **kwargs: Any) -> None: class ContainerRegistryBasicCredentials(ContainerRegistryCredentials): """The basic authentication properties for the container registry resource. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The credential type of the container registry credentials. Required. :vartype type: str @@ -3866,7 +3848,7 @@ class ContainerRegistryProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar credentials: The credentials of the container registry resource. Required. :vartype credentials: @@ -3980,7 +3962,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -4112,7 +4094,7 @@ def __init__( class CustomContainerUserSourceInfo(UserSourceInfo): """Custom container user source info. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4270,7 +4252,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -4324,7 +4306,7 @@ class CustomizedAcceleratorProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar provisioning_state: State of the customized accelerator. Known values are: "Creating", "Updating", "Succeeded", "Failed", and "Deleting". @@ -4517,7 +4499,7 @@ def __init__( class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -5370,7 +5352,7 @@ class ProbeAction(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ExecAction, HTTPGetAction, TCPSocketAction - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -5398,7 +5380,7 @@ def __init__(self, **kwargs: Any) -> None: class ExecAction(ProbeAction): """ExecAction describes a "run in container" action. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -6345,7 +6327,7 @@ def __init__( class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -6447,7 +6429,7 @@ def __init__( class HTTPGetAction(ProbeAction): """HTTPGetAction describes an action based on HTTP Get requests. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -6675,7 +6657,7 @@ class UploadedUserSourceInfo(UserSourceInfo): You probably want to use the sub-classes and not this class directly. Known sub-classes are: JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -6718,7 +6700,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -6774,7 +6756,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -6868,7 +6850,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -6902,7 +6884,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -7356,7 +7338,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -7389,7 +7371,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7874,7 +7856,7 @@ class Probe(_serialization.Model): """Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive traffic. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar probe_action: The action of the probe. :vartype probe_action: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ProbeAction @@ -7995,7 +7977,7 @@ def __init__( class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2023_03_01_preview.models.TestKeyType @@ -9038,7 +9020,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -9112,7 +9094,7 @@ def __init__(self, *, sku: Optional["_models.Sku"] = None, **kwargs: Any) -> Non class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -9253,7 +9235,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2023_03_01_preview.models.StorageType @@ -9278,7 +9260,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2023_03_01_preview.models.StorageType @@ -9739,7 +9721,7 @@ def __init__( class TCPSocketAction(ProbeAction): """TCPSocketAction describes an action based on opening a socket. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_api_portal_custom_domains_operations.py index 4f2b6e6103b..025f2df1551 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_api_portals_operations.py index 75ea7bab833..ddbf1fc5d6b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -465,20 +438,9 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -524,17 +486,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -555,22 +515,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,11 +539,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -599,14 +554,6 @@ def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -636,7 +583,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,17 +592,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: @@ -666,7 +609,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.ApiPortalResource] @@ -691,17 +633,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -712,14 +653,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -729,11 +670,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -745,10 +686,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload def validate_domain( self, @@ -775,7 +712,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -787,7 +723,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -802,11 +738,10 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -818,7 +753,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -831,13 +766,9 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -867,7 +798,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -876,16 +807,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +827,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_application_accelerators_operations.py index 9ab9d3392e0..620a7d68ed0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -204,7 +204,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -230,17 +229,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -251,14 +249,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -268,11 +266,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -284,10 +282,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -301,7 +295,6 @@ def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -322,22 +315,21 @@ def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,20 +341,16 @@ def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -390,7 +378,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -399,16 +387,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,10 +415,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -459,14 +442,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -480,7 +455,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -496,18 +471,10 @@ def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -521,7 +488,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -534,20 +501,9 @@ def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -583,7 +539,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -593,17 +549,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -624,22 +578,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -649,11 +602,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -668,14 +617,6 @@ def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -705,7 +646,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -714,14 +655,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_application_live_views_operations.py index 8b278e82834..68cc4c3435f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -198,7 +198,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -224,17 +223,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -245,14 +243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -262,11 +260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -278,10 +276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -295,7 +289,6 @@ def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -316,22 +309,21 @@ def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,20 +335,16 @@ def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -526,20 +493,9 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -616,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_apps_operations.py index b78c9403bd2..dd3e859025b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -373,23 +372,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -401,20 +399,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -442,7 +436,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -451,16 +445,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -483,10 +476,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -512,14 +501,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -533,7 +514,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -548,18 +529,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -573,7 +546,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -586,19 +559,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -634,7 +596,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -644,17 +606,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -675,22 +635,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -700,11 +659,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -719,14 +674,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -756,7 +703,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -765,24 +712,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -810,7 +753,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -819,16 +762,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -848,10 +790,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -877,14 +815,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -898,7 +828,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -913,18 +843,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -938,7 +860,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -950,20 +872,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -999,7 +910,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1009,17 +920,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1030,7 +939,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.AppResource] @@ -1055,17 +963,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1076,14 +983,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1093,11 +1000,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1109,10 +1016,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1126,7 +1029,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1147,22 +1049,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,20 +1075,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1215,7 +1112,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1224,16 +1121,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1253,10 +1149,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1283,14 +1175,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1304,7 +1188,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1319,18 +1203,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1344,7 +1220,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1357,20 +1233,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1406,7 +1271,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1416,17 +1281,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1454,7 +1317,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1466,7 +1328,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1481,11 +1343,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1497,7 +1358,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1510,13 +1371,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1546,7 +1403,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1555,16 +1412,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,10 +1432,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_bindings_operations.py index e70c9ccfe29..ebc4b53f741 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -871,20 +793,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.BindingResource] @@ -981,18 +889,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +910,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1020,11 +927,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1035,7 +942,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_build_service_agent_pool_operations.py index b5faaee763e..95d1711ca78 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -209,18 +208,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -231,14 +229,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -248,11 +246,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -264,10 +262,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -283,7 +277,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -304,23 +297,22 @@ def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -332,13 +324,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -346,7 +334,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -374,7 +362,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -384,16 +372,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -413,10 +400,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -446,14 +429,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -468,7 +443,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -485,18 +460,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -511,7 +478,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -526,20 +493,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -576,7 +532,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +542,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_build_service_builder_operations.py index b6f679d0415..f36f1c72754 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -261,7 +261,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -282,23 +281,22 @@ def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -310,13 +308,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -324,7 +318,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -352,7 +346,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -362,16 +356,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -391,10 +384,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -423,14 +412,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -445,7 +426,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -462,18 +443,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -488,7 +461,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -503,20 +476,9 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -553,7 +515,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -563,17 +525,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -594,23 +554,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -620,11 +579,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -641,14 +596,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -679,7 +626,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -688,17 +635,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -713,7 +656,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.BuilderResource] @@ -738,18 +680,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -760,14 +701,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -777,11 +718,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,10 +734,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -812,7 +749,6 @@ def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -833,23 +769,22 @@ def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -861,10 +796,6 @@ def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_build_service_operations.py index 5fa1eb35e4f..cbe46212ac9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -607,7 +607,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildService] @@ -632,17 +631,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -653,14 +651,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -670,11 +668,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -686,10 +684,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -703,7 +697,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -724,22 +717,21 @@ def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,20 +743,16 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> _models.BuildService: error_map = { @@ -792,7 +780,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(build_service, "BuildService") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -801,16 +789,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -830,10 +817,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } - @overload def begin_create_or_update( self, @@ -859,14 +842,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -880,7 +855,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: IO, + build_service: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -895,18 +870,10 @@ def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Required. - :type build_service: IO + :type build_service: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -920,7 +887,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildService]: """Create a build service resource. @@ -933,19 +900,9 @@ def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Is either a BuildService type or a - IO type. Required. - :type build_service: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildService or + IO[bytes] :return: An instance of LROPoller that returns either BuildService or the result of cls(response) :rtype: @@ -981,7 +938,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -993,17 +950,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildService].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return LROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_builds( @@ -1018,7 +973,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -1042,18 +996,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1064,14 +1017,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -1081,11 +1034,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1097,10 +1050,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1116,7 +1065,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1137,23 +1085,22 @@ def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1165,13 +1112,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -1201,7 +1144,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1214,7 +1156,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1231,11 +1173,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1248,7 +1189,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -1262,13 +1203,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2023_03_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2023_03_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1298,7 +1235,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1308,16 +1245,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1337,10 +1273,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - def _delete_build_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> None: @@ -1360,23 +1292,22 @@ def _delete_build_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_build_request( + _request = build_delete_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_build_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1390,11 +1321,7 @@ def _delete_build_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_build_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete_build( @@ -1411,14 +1338,6 @@ def begin_delete_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_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: @@ -1449,7 +1368,7 @@ def begin_delete_build( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1460,17 +1379,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_build_results( @@ -1487,7 +1402,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildResult] @@ -1512,19 +1426,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1535,14 +1448,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1552,11 +1465,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1568,10 +1481,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1595,7 +1504,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1616,7 +1524,7 @@ def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1624,16 +1532,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1645,13 +1552,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1676,7 +1579,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1697,7 +1599,7 @@ def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1705,16 +1607,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1726,13 +1627,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1747,7 +1644,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1768,22 +1664,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1795,13 +1690,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1816,7 +1707,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1837,22 +1727,21 @@ def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1864,13 +1753,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1887,7 +1772,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1908,23 +1792,22 @@ def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1936,13 +1819,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1957,7 +1836,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1978,22 +1856,21 @@ def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2005,13 +1882,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -2028,7 +1901,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -2049,23 +1921,22 @@ def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2077,10 +1948,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_buildpack_binding_operations.py index 43cbdea7c44..659b3f007a2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -262,7 +262,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -288,17 +287,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -309,14 +307,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -326,11 +324,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -342,10 +340,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace def get( self, @@ -369,7 +363,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -390,7 +383,7 @@ def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -398,16 +391,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -419,13 +411,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -434,7 +422,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -462,7 +450,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -473,16 +461,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -502,10 +489,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -539,14 +522,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -562,7 +537,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -582,18 +557,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -609,7 +576,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -626,20 +593,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -677,7 +633,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -687,17 +643,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -724,7 +678,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -732,16 +686,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,11 +704,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -780,14 +729,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -819,7 +760,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -828,17 +769,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -855,7 +792,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -881,19 +817,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -904,14 +839,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -921,11 +856,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -936,7 +871,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_certificates_operations.py index 9c28a349991..335f0dbfc94 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -493,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -524,22 +484,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -549,11 +508,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -568,14 +523,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -605,7 +552,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -614,17 +561,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -637,7 +580,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.CertificateResource] @@ -662,17 +604,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -683,14 +624,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -700,11 +641,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -715,7 +656,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_config_servers_operations.py index 403ea027fbe..030eec211bb 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -474,23 +436,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -518,7 +478,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -526,16 +486,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,10 +514,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -582,14 +537,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -602,7 +549,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -615,18 +562,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -639,7 +578,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -650,20 +589,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -698,7 +626,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -708,23 +636,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -752,7 +678,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -760,16 +686,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -789,10 +714,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -816,14 +737,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -836,7 +749,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -849,18 +762,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -873,7 +778,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -884,20 +789,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -932,7 +826,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -944,14 +838,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_configuration_services_operations.py index 6d617a70825..1f6ca58716f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -393,14 +382,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -414,7 +395,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -430,18 +411,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -469,20 +442,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -559,22 +519,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,11 +543,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -603,14 +558,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -640,7 +587,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -649,17 +596,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -672,7 +615,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -698,17 +640,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -719,14 +660,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -736,11 +677,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -752,16 +693,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -789,7 +726,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -798,16 +735,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -827,10 +763,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -856,14 +788,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -877,7 +801,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -892,18 +816,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -917,7 +833,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -930,20 +846,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -979,7 +884,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -991,14 +896,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_container_registries_operations.py index 9f855a353d7..7cd7c1b3c9b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_container_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_container_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -170,7 +170,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContainerRegistryResource or the result of cls(response) :rtype: @@ -196,17 +195,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -217,14 +215,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) @@ -234,11 +232,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -250,10 +248,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -267,7 +261,6 @@ def get( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ContainerRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -288,22 +281,21 @@ def get( ) cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -315,20 +307,16 @@ def get( deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> _models.ContainerRegistryResource: error_map = { @@ -356,7 +344,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -365,16 +353,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -394,10 +381,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } - @overload def begin_create_or_update( self, @@ -424,14 +407,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -445,7 +420,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: IO, + container_registry_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -460,18 +435,10 @@ def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Required. - :type container_registry_resource: IO + :type container_registry_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -485,7 +452,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ContainerRegistryResource]: """Create or update container registry resource. @@ -498,20 +465,9 @@ def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Is either a - ContainerRegistryResource type or a IO type. Required. + ContainerRegistryResource type or a IO[bytes] type. Required. :type container_registry_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.ContainerRegistryResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.ContainerRegistryResource or IO[bytes] :return: An instance of LROPoller that returns either ContainerRegistryResource or the result of cls(response) :rtype: @@ -547,7 +503,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -559,14 +515,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ContainerRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return LROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_custom_domains_operations.py index 152431863f7..096178a8f16 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -871,20 +793,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -982,18 +890,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1004,14 +911,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1021,11 +928,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,7 +943,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_customized_accelerators_operations.py index 257eb5fd57f..5b02afa5a16 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -272,7 +272,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -298,18 +297,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -320,14 +318,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -337,11 +335,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +351,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace def get( self, @@ -377,7 +371,6 @@ def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -398,23 +391,22 @@ def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,13 +418,9 @@ def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -440,7 +428,7 @@ def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -468,7 +456,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -478,16 +466,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -507,10 +494,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -541,14 +524,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -563,7 +538,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +556,10 @@ def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -607,7 +574,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -622,20 +589,9 @@ def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -672,7 +628,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -682,17 +638,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -718,23 +672,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -744,11 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -770,14 +719,6 @@ def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -808,7 +749,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -817,17 +758,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def validate( @@ -858,7 +795,6 @@ def validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -872,7 +808,7 @@ def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -889,11 +825,10 @@ def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -907,7 +842,7 @@ def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -922,13 +857,9 @@ def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -959,7 +890,7 @@ def validate( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -969,16 +900,15 @@ def validate( content_type=content_type, json=_json, content=_content, - template_url=self.validate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -992,10 +922,6 @@ def validate( deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_deployments_operations.py index 7860fb55b27..265d8c2e3b7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -468,7 +468,7 @@ def build_disable_remote_debugging_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_remote_debugging_config_request( +def build_get_remote_debugging_config_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, app_name: str, @@ -702,7 +702,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -723,23 +722,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,13 +749,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -765,7 +759,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -793,7 +787,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -803,16 +797,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -835,10 +828,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -868,14 +857,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -890,7 +871,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -907,18 +888,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -933,7 +906,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -948,20 +921,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -998,7 +960,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1008,17 +970,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1039,23 +999,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1065,11 +1024,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -1086,14 +1041,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1124,7 +1071,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1133,17 +1080,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1151,7 +1094,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1179,7 +1122,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1189,16 +1132,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1218,10 +1160,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1251,14 +1189,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1273,7 +1203,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1290,18 +1220,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1316,7 +1238,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1331,20 +1253,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1381,7 +1292,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1391,17 +1302,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1423,7 +1332,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentResource] @@ -1448,19 +1356,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1471,14 +1378,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1488,11 +1395,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1504,10 +1411,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1521,7 +1424,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.DeploymentResource] @@ -1546,18 +1448,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1568,14 +1469,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1585,11 +1486,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1601,10 +1502,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1624,23 +1521,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1650,11 +1546,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1671,14 +1563,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1709,7 +1593,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1718,17 +1602,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1749,23 +1629,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1775,11 +1654,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1796,14 +1671,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1834,7 +1701,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1843,17 +1710,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1874,23 +1737,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1900,11 +1762,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1921,14 +1779,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1959,7 +1809,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1968,17 +1818,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_remote_debugging_initial( self, @@ -1986,7 +1832,7 @@ def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -2017,7 +1863,7 @@ def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2027,16 +1873,15 @@ def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2056,10 +1901,6 @@ def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload def begin_enable_remote_debugging( self, @@ -2089,14 +1930,6 @@ def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2111,7 +1944,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2128,18 +1961,10 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2154,7 +1979,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> LROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -2169,20 +1994,9 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of LROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -2219,7 +2033,7 @@ def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2229,17 +2043,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2260,23 +2072,22 @@ def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2296,10 +2107,6 @@ def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2315,14 +2122,6 @@ def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -2356,7 +2155,7 @@ def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2366,17 +2165,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def get_remote_debugging_config( @@ -2393,7 +2190,6 @@ def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -2414,23 +2210,22 @@ def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2442,13 +2237,9 @@ def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace def get_log_file_url( @@ -2465,7 +2256,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -2486,23 +2276,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2516,13 +2305,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2530,7 +2315,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2558,7 +2343,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2568,16 +2353,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2587,11 +2371,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2622,14 +2402,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2642,7 +2414,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2659,18 +2431,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2683,7 +2447,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2698,20 +2462,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2745,7 +2498,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2754,17 +2507,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2772,7 +2521,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2800,7 +2549,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2810,16 +2559,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2829,11 +2577,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2864,14 +2608,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2884,7 +2620,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2901,18 +2637,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2925,7 +2653,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2940,20 +2668,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2987,7 +2704,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2996,17 +2713,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -3014,7 +2727,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -3042,7 +2755,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -3052,16 +2765,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -3071,11 +2783,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -3106,14 +2814,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -3126,7 +2826,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -3143,18 +2843,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -3167,7 +2859,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -3182,20 +2874,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -3229,7 +2910,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3238,14 +2919,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_dev_tool_portals_operations.py index 9064b004d3c..1fef7d1e5e1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -198,7 +198,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -224,17 +223,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -245,14 +243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -262,11 +260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -278,10 +276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -295,7 +289,6 @@ def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -316,22 +309,21 @@ def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,20 +335,16 @@ def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -526,20 +493,9 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of LROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -616,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_gateway_custom_domains_operations.py index 06fc237f43f..0247a881555 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_gateway_route_configs_operations.py index 4526af1b174..017e955add6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload def begin_create_or_update( self, @@ -388,14 +377,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -410,7 +391,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -429,18 +410,10 @@ def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -471,20 +444,9 @@ def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -521,7 +483,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -531,17 +493,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -562,23 +522,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,11 +547,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -609,14 +564,6 @@ def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -647,7 +594,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -656,17 +603,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -681,7 +624,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -707,18 +649,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -729,14 +670,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -746,11 +687,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -761,7 +702,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_gateways_operations.py index 0314b39a06f..8995793d2d3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -334,7 +334,6 @@ def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -355,22 +354,21 @@ def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -382,20 +380,16 @@ def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -423,7 +417,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -432,16 +426,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -461,10 +454,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload def begin_create_or_update( self, @@ -490,14 +479,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -511,7 +492,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -526,18 +507,10 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -551,7 +524,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -564,20 +537,9 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -613,7 +575,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -623,24 +585,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_capacity_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> Optional[_models.GatewayResource]: error_map = { @@ -668,7 +628,7 @@ def _update_capacity_initial( else: _json = self._serialize.body(gateway_capacity_resource, "SkuObject") - request = build_update_capacity_request( + _request = build_update_capacity_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -677,16 +637,15 @@ def _update_capacity_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_capacity_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -704,13 +663,9 @@ def _update_capacity_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_capacity_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore @overload def begin_update_capacity( @@ -737,14 +692,6 @@ def begin_update_capacity( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -758,7 +705,7 @@ def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: IO, + gateway_capacity_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -773,18 +720,10 @@ def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Required. - :type gateway_capacity_resource: IO + :type gateway_capacity_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -798,7 +737,7 @@ def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Operation to update an exiting Spring Cloud Gateway capacity. @@ -811,20 +750,9 @@ def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a - SkuObject type or a IO type. Required. + SkuObject type or a IO[bytes] type. Required. :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.SkuObject - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -860,7 +788,7 @@ def begin_update_capacity( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -872,17 +800,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_capacity.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -903,22 +829,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -928,11 +853,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -947,14 +868,6 @@ def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -984,7 +897,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -993,17 +906,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_env_secrets( @@ -1018,7 +927,6 @@ def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -1039,22 +947,21 @@ def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1066,13 +973,9 @@ def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -1093,22 +996,21 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1122,11 +1024,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_restart( @@ -1141,14 +1039,6 @@ def begin_restart( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -1178,7 +1068,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1189,17 +1079,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: @@ -1210,7 +1096,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.GatewayResource] @@ -1235,17 +1120,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1256,14 +1140,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -1273,11 +1157,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1289,10 +1173,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload def validate_domain( self, @@ -1319,7 +1199,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1331,7 +1210,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1346,11 +1225,10 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1362,7 +1240,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -1375,13 +1253,9 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1411,7 +1285,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1420,16 +1294,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1441,10 +1314,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_monitoring_settings_operations.py index 5ccf0a1b71e..8166e566939 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -440,23 +402,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -484,7 +444,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -492,16 +452,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -521,10 +480,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -548,14 +503,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -568,7 +515,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +528,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -605,7 +544,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -616,20 +555,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_03_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -664,7 +592,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -674,14 +602,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_operations.py index bea856f4880..80ebddff74a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_predefined_accelerators_operations.py index d153550489f..8fe27307422 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -225,7 +225,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -251,18 +250,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -273,14 +271,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -290,11 +288,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +304,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace def get( self, @@ -330,7 +324,6 @@ def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -351,23 +344,22 @@ def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -379,13 +371,9 @@ def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -411,23 +399,22 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +424,7 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_disable( @@ -463,14 +446,6 @@ def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -501,7 +476,7 @@ def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -510,17 +485,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -546,23 +517,22 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -572,11 +542,7 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_enable( @@ -598,14 +564,6 @@ def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -636,7 +594,7 @@ def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,14 +603,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_runtime_versions_operations.py index 30af9c3ab32..f543340b2f1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_service_registries_operations.py index f1e65252b37..0be6cd1e7e6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -217,22 +216,21 @@ def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,13 +242,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -271,22 +265,21 @@ def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +299,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -323,14 +312,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -373,17 +354,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -404,22 +383,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,11 +407,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -448,14 +422,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -485,7 +451,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -494,17 +460,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -517,7 +479,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -543,17 +504,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -581,11 +541,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +556,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_services_operations.py index 49754521000..73ab58cdb1c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -466,7 +466,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -487,21 +486,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -513,16 +511,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -549,7 +547,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -557,16 +555,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,10 +586,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -615,14 +608,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -635,7 +620,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -648,18 +633,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -669,7 +646,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -679,19 +660,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -726,7 +696,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -736,17 +706,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -767,21 +735,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -791,11 +758,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -806,14 +769,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -842,7 +797,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -851,20 +806,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -891,7 +846,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -899,16 +854,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -928,10 +882,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -954,14 +904,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -974,7 +916,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -987,18 +929,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1008,7 +942,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1017,20 +955,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1065,7 +992,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1075,17 +1002,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1096,7 +1021,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1117,21 +1041,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1143,13 +1066,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1174,7 +1093,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1185,7 +1103,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1198,11 +1116,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1213,7 +1130,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1224,13 +1141,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_03_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1260,7 +1173,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1268,16 +1181,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1289,13 +1201,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1308,7 +1216,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1329,21 +1236,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1353,11 +1259,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1368,7 +1270,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1389,21 +1290,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1415,13 +1315,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1442,35 +1338,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1481,14 +1372,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1517,7 +1400,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1526,17 +1409,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1557,35 +1436,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1596,14 +1470,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1632,7 +1498,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1641,17 +1507,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -1672,7 +1534,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1680,18 +1541,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1699,20 +1564,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2023_03_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_03_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1742,23 +1606,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1770,19 +1633,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceResource] @@ -1807,15 +1665,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1826,14 +1683,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1843,11 +1700,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1859,8 +1716,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -1868,7 +1723,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.ServiceResource] @@ -1893,16 +1747,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1913,14 +1766,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -1930,11 +1783,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1945,7 +1798,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_skus_operations.py index 39c01ce004e..6dd6420122f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_storages_operations.py index 2b8dbf1f50d..837abdfe55c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_03_01_preview/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_03_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -359,14 +348,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -380,7 +361,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -395,18 +376,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -420,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -433,20 +406,9 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2023_03_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -482,7 +444,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -492,17 +454,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -523,22 +483,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +507,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -567,14 +522,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -604,7 +551,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -613,17 +560,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -634,7 +577,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_03_01_preview.models.StorageResource] @@ -659,17 +601,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -680,14 +621,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -697,11 +638,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -712,7 +653,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/_app_platform_management_client.py index 71ae353d179..075ccdf7cbc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -166,7 +168,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -260,7 +280,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2023-05-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -280,7 +300,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/_configuration.py index ea1648ce3bc..59d7b612e23 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-05-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/_app_platform_management_client.py index ec93d0d13d3..a85ee4e772e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -166,7 +168,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -260,7 +280,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2023-05-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -280,7 +302,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/_configuration.py index aa085382767..ccd97728289 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-05-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_api_portal_custom_domains_operations.py index ceba643677e..b132e03821b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_api_portals_operations.py index 9ef53895310..4532a6b6dcd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -365,17 +327,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -396,22 +356,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -440,14 +395,6 @@ async def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -477,7 +424,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -486,17 +433,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -509,7 +452,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.ApiPortalResource] @@ -534,17 +476,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -555,14 +496,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -572,11 +513,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +529,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload async def validate_domain( self, @@ -618,7 +555,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -630,7 +566,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -645,11 +581,10 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -661,7 +596,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -674,13 +609,9 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -710,7 +641,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -719,16 +650,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,10 +670,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_apms_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_apms_operations.py index e792beaaa9d..28221ff4a1b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_apms_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_apms_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -72,7 +72,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApmResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmResource] @@ -97,17 +96,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -118,14 +116,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApmResourceCollection", pipeline_response) @@ -135,11 +133,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -151,10 +149,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -168,7 +162,6 @@ async def get( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmResource :raises ~azure.core.exceptions.HttpResponseError: @@ -189,22 +182,21 @@ async def get( ) cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -216,20 +208,16 @@ async def get( deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> _models.ApmResource: error_map = { @@ -257,7 +245,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(apm_resource, "ApmResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, @@ -266,16 +254,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -295,10 +282,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } - @overload async def begin_create_or_update( self, @@ -324,14 +307,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -345,7 +320,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: IO, + apm_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -360,18 +335,10 @@ async def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Required. - :type apm_resource: IO + :type apm_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -385,7 +352,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApmResource]: """Create or update an APM. @@ -398,19 +365,8 @@ async def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Is either a ApmResource - type or a IO type. Required. - :type apm_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApmResource or the result of cls(response) :rtype: @@ -446,7 +402,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -456,17 +412,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApmResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return AsyncLROPoller[_models.ApmResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -487,22 +441,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -583,17 +524,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_secret_keys( @@ -608,7 +545,6 @@ async def list_secret_keys( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmSecretKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmSecretKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -629,22 +565,21 @@ async def list_secret_keys( ) cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None) - request = build_list_secret_keys_request( + _request = build_list_secret_keys_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_secret_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -656,10 +591,6 @@ async def list_secret_keys( deserialized = self._deserialize("ApmSecretKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_secret_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_application_accelerators_operations.py index 13b51054a0c..3f579778441 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -328,14 +311,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -349,7 +324,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -365,18 +340,10 @@ async def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -390,7 +357,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -403,20 +370,9 @@ async def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -452,7 +408,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -462,17 +418,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -493,22 +447,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -518,11 +471,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -537,14 +486,6 @@ async def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -574,7 +515,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -583,14 +524,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_application_live_views_operations.py index d01134bd20f..4abf12b30b6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -581,14 +522,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_apps_operations.py index 1914bf1e0f5..4d96abc09d1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,20 +133,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -176,7 +170,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -185,16 +179,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -217,10 +210,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -246,14 +235,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -267,7 +248,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -320,19 +293,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -368,7 +330,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -378,17 +340,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -409,22 +369,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,11 +393,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -453,14 +408,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -490,7 +437,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -499,24 +446,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -544,7 +487,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -553,16 +496,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,10 +524,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -611,14 +549,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -632,7 +562,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -647,18 +577,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -672,7 +594,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -684,20 +606,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -733,7 +644,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -743,17 +654,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -764,7 +673,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.AppResource] @@ -789,17 +697,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -810,14 +717,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -827,11 +734,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -843,10 +750,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -860,7 +763,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -881,22 +783,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -908,20 +809,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -949,7 +846,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -958,16 +855,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -987,10 +883,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -1017,14 +909,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1038,7 +922,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1053,18 +937,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1078,7 +954,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1091,20 +967,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1140,7 +1005,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1150,17 +1015,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1188,7 +1051,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1200,7 +1062,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1215,11 +1077,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1231,7 +1092,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1244,13 +1105,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1280,7 +1137,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1289,16 +1146,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1310,10 +1166,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_bindings_operations.py index 85d48b73682..2fe0288fae1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -705,20 +627,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.BindingResource] @@ -815,18 +723,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -837,14 +744,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -854,11 +761,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -869,7 +776,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_build_service_agent_pool_operations.py index 419bdd3367e..e4d524619c6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -174,7 +168,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -195,23 +188,22 @@ async def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -223,13 +215,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -237,7 +225,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -265,7 +253,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -275,16 +263,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -304,10 +291,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -337,14 +320,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -359,7 +334,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +351,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -402,7 +369,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -417,20 +384,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -467,7 +423,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -477,14 +433,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_build_service_builder_operations.py index bd9878aeec2..40f61a3ba37 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,10 +201,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -240,14 +229,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -262,7 +243,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -279,18 +260,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -305,7 +278,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -320,20 +293,9 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -370,7 +332,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -380,17 +342,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -411,23 +371,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +396,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -458,14 +413,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -496,7 +443,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -505,17 +452,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -530,7 +473,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.BuilderResource] @@ -555,18 +497,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -577,14 +518,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -594,11 +535,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -610,10 +551,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace_async async def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -629,7 +566,6 @@ async def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -650,23 +586,22 @@ async def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -678,10 +613,6 @@ async def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_build_service_operations.py index 2fd8d368daa..b541c3cbe32 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildService] @@ -109,17 +108,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -130,14 +128,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -147,11 +145,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -163,10 +161,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -180,7 +174,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -201,22 +194,21 @@ async def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,20 +220,16 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> _models.BuildService: error_map = { @@ -269,7 +257,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(build_service, "BuildService") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -278,16 +266,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,10 +294,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } - @overload async def begin_create_or_update( self, @@ -336,14 +319,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -357,7 +332,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: IO, + build_service: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -372,18 +347,10 @@ async def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Required. - :type build_service: IO + :type build_service: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -397,7 +364,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildService]: """Create a build service resource. @@ -410,19 +377,9 @@ async def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Is either a BuildService type or a - IO type. Required. - :type build_service: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildService or + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildService or the result of cls(response) :rtype: @@ -458,7 +415,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -470,17 +427,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildService].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return AsyncLROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_builds( @@ -495,7 +450,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.Build] @@ -520,18 +474,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -542,14 +495,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -559,11 +512,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -575,10 +528,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -594,7 +543,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -615,23 +563,22 @@ async def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -643,13 +590,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -679,7 +622,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -692,7 +634,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -709,11 +651,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -726,7 +667,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -740,13 +681,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2023_05_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2023_05_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -776,7 +713,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -786,16 +723,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -815,10 +751,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - async def _delete_build_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> None: @@ -838,23 +770,22 @@ async def _delete_build_initial( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_build_request( + _request = build_delete_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_build_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -868,11 +799,7 @@ async def _delete_build_initial( # pylint: disable=inconsistent-return-statemen response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_build_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete_build( @@ -889,14 +816,6 @@ async def begin_delete_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_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: @@ -927,7 +846,7 @@ async def begin_delete_build( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -938,17 +857,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_build_results( @@ -965,7 +880,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildResult] @@ -990,19 +904,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1013,14 +926,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1030,11 +943,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1046,10 +959,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -1073,7 +982,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1094,7 +1002,7 @@ async def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1102,16 +1010,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1123,13 +1030,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -1154,7 +1057,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1175,7 +1077,7 @@ async def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1183,16 +1085,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1204,13 +1105,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -1225,7 +1122,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1246,22 +1142,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1273,13 +1168,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -1294,7 +1185,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1315,22 +1205,21 @@ async def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1342,13 +1231,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -1365,7 +1250,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1386,23 +1270,22 @@ async def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1414,13 +1297,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1435,7 +1314,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1456,22 +1334,21 @@ async def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1483,13 +1360,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1506,7 +1379,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1527,23 +1399,22 @@ async def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1555,10 +1426,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_buildpack_binding_operations.py index 4c17ce33a24..e94c7803c6b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -100,17 +99,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -121,14 +119,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -138,11 +136,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,10 +152,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,7 +195,7 @@ async def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -210,16 +203,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -231,13 +223,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -246,7 +234,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -274,7 +262,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -285,16 +273,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -314,10 +301,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -351,14 +334,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -374,7 +349,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -394,18 +369,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -421,7 +388,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -438,20 +405,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -489,7 +445,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -499,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -536,7 +490,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -544,16 +498,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -563,11 +516,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -592,14 +541,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -631,7 +572,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -640,17 +581,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -667,7 +604,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -693,19 +629,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -716,14 +651,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -733,11 +668,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -748,7 +683,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_certificates_operations.py index 389e2c0e23c..b84ff2fb9ed 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,17 +330,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -399,22 +359,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,11 +383,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -443,14 +398,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -489,17 +436,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -512,7 +455,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.CertificateResource] @@ -537,17 +479,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -558,14 +499,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -575,11 +516,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -590,7 +531,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_config_servers_operations.py index 483217cbce7..0a99af9682e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -345,23 +307,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -389,7 +349,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -397,16 +357,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,10 +385,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -453,14 +408,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -473,7 +420,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -486,18 +433,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -510,7 +449,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -521,20 +460,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -569,7 +497,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -579,23 +507,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -623,7 +549,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -631,16 +557,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -660,10 +585,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -687,14 +608,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -707,7 +620,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -720,18 +633,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -744,7 +649,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -755,20 +660,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -803,7 +697,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -815,14 +709,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_configuration_services_operations.py index 05f76d605fa..2dbfd30c385 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -310,20 +283,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -359,7 +321,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -369,17 +331,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -400,22 +360,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -425,11 +384,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -444,14 +399,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -481,7 +428,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -490,17 +437,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -513,7 +456,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -539,17 +481,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -560,14 +501,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -577,11 +518,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,16 +534,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -630,7 +567,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -639,16 +576,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -668,10 +604,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -697,14 +629,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -718,7 +642,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -733,18 +657,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -758,7 +674,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -771,20 +687,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -820,7 +725,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -832,14 +737,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_container_registries_operations.py index 689675a347d..00d82a498fc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_container_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_container_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContainerRegistryResource or the result of cls(response) :rtype: @@ -100,17 +99,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -121,14 +119,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) @@ -138,11 +136,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,10 +152,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -171,7 +165,6 @@ async def get( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ContainerRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -192,22 +185,21 @@ async def get( ) cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -219,20 +211,16 @@ async def get( deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> _models.ContainerRegistryResource: error_map = { @@ -260,7 +248,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -269,16 +257,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -298,10 +285,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } - @overload async def begin_create_or_update( self, @@ -328,14 +311,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -349,7 +324,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: IO, + container_registry_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -364,18 +339,10 @@ async def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Required. - :type container_registry_resource: IO + :type container_registry_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -389,7 +356,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ContainerRegistryResource]: """Create or update container registry resource. @@ -402,20 +369,9 @@ async def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Is either a - ContainerRegistryResource type or a IO type. Required. + ContainerRegistryResource type or a IO[bytes] type. Required. :type container_registry_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ContainerRegistryResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ContainerRegistryResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the result of cls(response) :rtype: @@ -451,7 +407,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -463,17 +419,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ContainerRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return AsyncLROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -494,22 +448,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -523,11 +476,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -542,14 +491,6 @@ async def begin_delete( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_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: @@ -579,7 +520,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -590,24 +531,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _validate_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.ContainerRegistryValidateResult]: error_map = { @@ -635,7 +572,7 @@ async def _validate_initial( else: _json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -644,16 +581,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -671,13 +607,9 @@ async def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return deserialized # type: ignore @overload async def begin_validate( @@ -705,14 +637,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -726,7 +650,7 @@ async def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: IO, + container_registry_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -741,18 +665,10 @@ async def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Required. - :type container_registry_properties: IO + :type container_registry_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -766,7 +682,7 @@ async def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]: """Check if the container registry properties are valid. @@ -779,20 +695,9 @@ async def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Is either a - ContainerRegistryProperties type or a IO type. Required. + ContainerRegistryProperties type or a IO[bytes] type. Required. :type container_registry_properties: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ContainerRegistryProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ContainerRegistryProperties or IO[bytes] :return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -828,7 +733,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -840,14 +745,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ContainerRegistryValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return AsyncLROPoller[_models.ContainerRegistryValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_custom_domains_operations.py index 3bbcc34c218..c6798ce1267 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -705,20 +627,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -816,18 +724,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -838,14 +745,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -855,11 +762,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -870,7 +777,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_customized_accelerators_operations.py index 8e373e95da7..3c515b9c0bc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -102,18 +101,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -124,14 +122,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -141,11 +139,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,10 +155,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,23 +195,22 @@ async def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -230,13 +222,9 @@ async def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -244,7 +232,7 @@ async def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -272,7 +260,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -282,16 +270,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -311,10 +298,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -345,14 +328,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -367,7 +342,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -385,18 +360,10 @@ async def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -411,7 +378,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -426,20 +393,9 @@ async def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -476,7 +432,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -486,17 +442,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -522,23 +476,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +501,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -574,14 +523,6 @@ async def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -612,7 +553,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -621,17 +562,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def validate( @@ -662,7 +599,6 @@ async def validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -676,7 +612,7 @@ async def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -693,11 +629,10 @@ async def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -711,7 +646,7 @@ async def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -726,13 +661,9 @@ async def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -763,7 +694,7 @@ async def validate( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -773,16 +704,15 @@ async def validate( content_type=content_type, json=_json, content=_content, - template_url=self.validate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -796,10 +726,6 @@ async def validate( deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_deployments_operations.py index a2d3796566a..a7a9751144f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -89,7 +89,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -110,23 +109,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -138,13 +136,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -152,7 +146,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -180,7 +174,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -190,16 +184,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -222,10 +215,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -255,14 +244,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -277,7 +258,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -294,18 +275,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -320,7 +293,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -335,20 +308,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -385,7 +347,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -395,17 +357,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -426,23 +386,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -452,11 +411,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -473,14 +428,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -511,7 +458,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -520,17 +467,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -538,7 +481,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -566,7 +509,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -576,16 +519,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -605,10 +547,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -638,14 +576,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -660,7 +590,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -677,18 +607,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -703,7 +625,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -718,20 +640,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -768,7 +679,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -778,17 +689,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -810,7 +719,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentResource] @@ -835,19 +743,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -858,14 +765,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -875,11 +782,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -891,10 +798,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -908,7 +811,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentResource] @@ -933,18 +835,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -955,14 +856,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -972,11 +873,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -988,10 +889,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1011,23 +908,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1037,11 +933,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1058,14 +950,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1096,7 +980,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1105,17 +989,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1136,23 +1016,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1162,11 +1041,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1183,14 +1058,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1221,7 +1088,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1230,17 +1097,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1261,23 +1124,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1287,11 +1149,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1308,14 +1166,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1346,7 +1196,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1355,17 +1205,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_remote_debugging_initial( self, @@ -1373,7 +1219,7 @@ async def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -1404,7 +1250,7 @@ async def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1414,16 +1260,15 @@ async def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1443,10 +1288,6 @@ async def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload async def begin_enable_remote_debugging( self, @@ -1476,14 +1317,6 @@ async def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1498,7 +1331,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1515,18 +1348,10 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1541,7 +1366,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> AsyncLROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -1556,20 +1381,9 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -1606,7 +1420,7 @@ async def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1616,17 +1430,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1647,23 +1459,22 @@ async def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1683,10 +1494,6 @@ async def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace_async async def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1702,14 +1509,6 @@ async def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -1743,7 +1542,7 @@ async def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1753,17 +1552,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def get_remote_debugging_config( @@ -1780,7 +1577,6 @@ async def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -1801,23 +1597,22 @@ async def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1829,13 +1624,9 @@ async def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1852,7 +1643,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1873,23 +1663,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1903,13 +1692,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1917,7 +1702,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1945,7 +1730,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1955,16 +1740,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1974,11 +1758,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -2009,14 +1789,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2029,7 +1801,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2046,18 +1818,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2070,7 +1834,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -2085,20 +1849,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2132,7 +1885,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2141,17 +1894,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2159,7 +1908,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2187,7 +1936,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2197,16 +1946,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2216,11 +1964,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -2251,14 +1995,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2271,7 +2007,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2288,18 +2024,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2312,7 +2040,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -2327,20 +2055,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2374,7 +2091,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2383,17 +2100,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2401,7 +2114,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2429,7 +2142,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2439,16 +2152,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2458,11 +2170,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2493,14 +2201,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2513,7 +2213,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2530,18 +2230,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2554,7 +2246,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2569,20 +2261,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2616,7 +2297,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2625,14 +2306,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_dev_tool_portals_operations.py index 0c72a019827..975091dfc57 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -581,14 +522,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_eureka_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_eureka_servers_operations.py index fbbd5281606..c48b71472d1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_eureka_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_eureka_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -70,7 +70,6 @@ async def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResourceCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.EurekaServerResourceCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -91,21 +90,20 @@ async def list( ) cls: ClsType[_models.EurekaServerResourceCollection] = kwargs.pop("cls", None) - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -117,13 +115,9 @@ async def list( deserialized = self._deserialize("EurekaServerResourceCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers" - } + return deserialized # type: ignore @distributed_trace_async async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.EurekaServerResource: @@ -134,7 +128,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.EurekaServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -155,21 +148,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -181,19 +173,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -221,7 +209,7 @@ async def _update_put_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -229,16 +217,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -261,10 +248,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload async def begin_update_put( self, @@ -288,14 +271,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -308,7 +283,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -321,18 +296,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -345,7 +312,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -356,20 +323,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -404,7 +360,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -417,23 +373,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return AsyncLROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -461,7 +415,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -469,16 +423,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -501,10 +454,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload async def begin_update_patch( self, @@ -528,14 +477,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -548,7 +489,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -561,18 +502,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -585,7 +518,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -596,20 +529,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -644,7 +566,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -656,14 +578,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return AsyncLROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_gateway_custom_domains_operations.py index d6a2aa9e805..63d69390c9f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_gateway_route_configs_operations.py index ef76774dd1f..68f09f676a8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -264,7 +245,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -283,18 +264,10 @@ async def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -309,7 +282,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -325,20 +298,9 @@ async def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -375,7 +337,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -385,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -416,23 +376,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +401,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +418,6 @@ async def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -501,7 +448,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -510,17 +457,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -535,7 +478,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -561,18 +503,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -583,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -600,11 +541,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -615,7 +556,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_gateways_operations.py index 854af15ef67..6c7c68f3492 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ async def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -100,22 +99,21 @@ async def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,20 +125,16 @@ async def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -177,16 +171,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -206,10 +199,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,24 +330,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_capacity_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> Optional[_models.GatewayResource]: error_map = { @@ -413,7 +373,7 @@ async def _update_capacity_initial( else: _json = self._serialize.body(gateway_capacity_resource, "SkuObject") - request = build_update_capacity_request( + _request = build_update_capacity_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -422,16 +382,15 @@ async def _update_capacity_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_capacity_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,13 +408,9 @@ async def _update_capacity_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_capacity_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore @overload async def begin_update_capacity( @@ -482,14 +437,6 @@ async def begin_update_capacity( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -503,7 +450,7 @@ async def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: IO, + gateway_capacity_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -518,18 +465,10 @@ async def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Required. - :type gateway_capacity_resource: IO + :type gateway_capacity_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -543,7 +482,7 @@ async def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Operation to update an exiting Spring Cloud Gateway capacity. @@ -556,20 +495,9 @@ async def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a - SkuObject type or a IO type. Required. + SkuObject type or a IO[bytes] type. Required. :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.SkuObject - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -605,7 +533,7 @@ async def begin_update_capacity( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -617,17 +545,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_capacity.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -648,22 +574,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -673,11 +598,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -692,14 +613,6 @@ async def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -729,7 +642,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -738,17 +651,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_env_secrets( @@ -763,7 +672,6 @@ async def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -784,22 +692,21 @@ async def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -811,13 +718,9 @@ async def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -838,22 +741,21 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -867,11 +769,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_restart( @@ -886,14 +784,6 @@ async def begin_restart( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -923,7 +813,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -934,17 +824,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -957,7 +843,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayResource] @@ -982,17 +867,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +887,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -1020,11 +904,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,10 +920,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload async def validate_domain( self, @@ -1066,7 +946,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1078,7 +957,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1093,11 +972,10 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1109,7 +987,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -1122,13 +1000,9 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1158,7 +1032,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1167,16 +1041,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1188,10 +1061,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_monitoring_settings_operations.py index 6cb88636ec4..a82867ab5d9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -346,23 +308,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -390,7 +350,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -398,16 +358,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,10 +386,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -454,14 +409,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -474,7 +421,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -487,18 +434,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -511,7 +450,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -522,20 +461,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +498,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -580,14 +508,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_operations.py index 1b24a95d25a..fcc720627f0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_predefined_accelerators_operations.py index 2efc9cee6aa..7a2f7cda157 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace_async async def get( self, @@ -179,7 +173,6 @@ async def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -200,23 +193,22 @@ async def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,13 +220,9 @@ async def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore async def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -260,23 +248,22 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -286,11 +273,7 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_disable( @@ -312,14 +295,6 @@ async def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -350,7 +325,7 @@ async def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -359,17 +334,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -395,23 +366,22 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +391,7 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_enable( @@ -447,14 +413,6 @@ async def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -485,7 +443,7 @@ async def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -494,14 +452,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_runtime_versions_operations.py index 6f08c1569c9..ea413a876b0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_service_registries_operations.py index 71004a5ae79..943bfa7303b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,13 +120,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -149,22 +143,21 @@ async def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -184,10 +177,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -201,14 +190,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -241,7 +222,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -251,17 +232,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -282,22 +261,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,11 +285,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -326,14 +300,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -363,7 +329,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -372,17 +338,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -395,7 +357,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -421,17 +382,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -442,14 +402,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -459,11 +419,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -474,7 +434,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_services_operations.py index 21de4505b9d..8c8aa671f57 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -105,21 +104,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -131,16 +129,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -167,7 +165,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -175,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -233,14 +226,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -253,7 +238,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -266,18 +251,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -287,7 +264,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -297,19 +278,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -344,7 +314,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -354,17 +324,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -385,21 +353,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -409,11 +376,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -424,14 +387,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -460,7 +415,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -469,20 +424,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -509,7 +464,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -517,16 +472,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -546,10 +500,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -572,14 +522,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -592,7 +534,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -605,18 +547,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -626,7 +560,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -635,20 +573,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -683,7 +610,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -693,17 +620,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -714,7 +639,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -735,21 +659,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -761,13 +684,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -792,7 +711,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -803,7 +721,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -816,11 +734,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -831,7 +748,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -842,13 +759,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_05_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -878,7 +791,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -886,16 +799,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -907,13 +819,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -926,7 +834,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -947,21 +854,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -971,11 +877,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -988,7 +890,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1009,21 +910,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1035,13 +935,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1062,35 +958,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1101,14 +992,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1137,7 +1020,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1146,17 +1029,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1177,35 +1056,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1216,14 +1090,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1252,7 +1118,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1261,17 +1127,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_supported_apm_types( @@ -1284,7 +1146,6 @@ def list_supported_apm_types( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedApmType or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.SupportedApmType] @@ -1309,17 +1170,16 @@ def list_supported_apm_types( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_apm_types_request( + _request = build_list_supported_apm_types_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_apm_types.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1330,14 +1190,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("SupportedApmTypes", pipeline_response) @@ -1347,11 +1207,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1363,10 +1223,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_supported_apm_types.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes" - } - @distributed_trace_async async def list_globally_enabled_apms( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1378,7 +1234,6 @@ async def list_globally_enabled_apms( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GloballyEnabledApms or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.GloballyEnabledApms :raises ~azure.core.exceptions.HttpResponseError: @@ -1399,21 +1254,20 @@ async def list_globally_enabled_apms( ) cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None) - request = build_list_globally_enabled_apms_request( + _request = build_list_globally_enabled_apms_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_globally_enabled_apms.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1425,16 +1279,12 @@ async def list_globally_enabled_apms( deserialized = self._deserialize("GloballyEnabledApms", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_globally_enabled_apms.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms" - } + return deserialized # type: ignore async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1461,7 +1311,7 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s else: _json = self._serialize.body(apm, "ApmReference") - request = build_enable_apm_globally_request( + _request = build_enable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1469,16 +1319,15 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s content_type=content_type, json=_json, content=_content, - template_url=self._enable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1492,11 +1341,7 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload async def begin_enable_apm_globally( @@ -1520,14 +1365,6 @@ async def begin_enable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1538,7 +1375,7 @@ async def begin_enable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1551,18 +1388,10 @@ async def begin_enable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the enable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1570,7 +1399,7 @@ async def begin_enable_apm_globally( @distributed_trace_async async def begin_enable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Enable an APM globally. @@ -1579,20 +1408,9 @@ async def begin_enable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the enable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the enable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmReference or IO[bytes] :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: @@ -1624,7 +1442,7 @@ async def begin_enable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1636,20 +1454,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1676,7 +1490,7 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(apm, "ApmReference") - request = build_disable_apm_globally_request( + _request = build_disable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1684,16 +1498,15 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._disable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1707,11 +1520,7 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload async def begin_disable_apm_globally( @@ -1735,14 +1544,6 @@ async def begin_disable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1753,7 +1554,7 @@ async def begin_disable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1766,18 +1567,10 @@ async def begin_disable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the disable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1785,7 +1578,7 @@ async def begin_disable_apm_globally( @distributed_trace_async async def begin_disable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Disable an APM globally. @@ -1794,20 +1587,9 @@ async def begin_disable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the disable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the disable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmReference or IO[bytes] :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: @@ -1839,7 +1621,7 @@ async def begin_disable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1851,17 +1633,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -1882,7 +1660,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1890,18 +1667,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1909,20 +1690,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_05_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1952,23 +1732,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1980,19 +1759,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceResource] @@ -2017,15 +1791,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2036,14 +1809,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2053,11 +1826,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2069,8 +1842,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -2078,7 +1849,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceResource] @@ -2103,16 +1873,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2123,14 +1892,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2140,11 +1909,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2155,7 +1924,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_skus_operations.py index d77f65247f4..e8793efffb2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_storages_operations.py index b8a522be490..3d8eb7d612f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -270,18 +251,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -295,7 +268,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -308,20 +281,9 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -357,7 +319,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -367,17 +329,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -398,22 +358,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -423,11 +382,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -442,14 +397,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -479,7 +426,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -488,17 +435,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -511,7 +454,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.StorageResource] @@ -536,17 +478,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -557,14 +498,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -574,11 +515,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,7 +530,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/models/_models_py3.py index 25e88b9a382..3ecf513a010 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/models/_models_py3.py @@ -30,7 +30,7 @@ class AcceleratorAuthSetting(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AcceleratorBasicAuthSetting, AcceleratorPublicSetting, AcceleratorSshSetting - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -61,7 +61,7 @@ def __init__(self, **kwargs: Any) -> None: class AcceleratorBasicAuthSetting(AcceleratorAuthSetting): """Auth setting for basic auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -106,7 +106,7 @@ def __init__( class AcceleratorGitRepository(_serialization.Model): """AcceleratorGitRepository. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: Git repository URL for the accelerator. Required. :vartype url: str @@ -175,7 +175,7 @@ def __init__( class AcceleratorPublicSetting(AcceleratorAuthSetting): """Auth setting for public url. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -205,7 +205,7 @@ def __init__(self, *, ca_cert_resource_id: Optional[str] = None, **kwargs: Any) class AcceleratorSshSetting(AcceleratorAuthSetting): """Auth setting for SSH auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -345,24 +345,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2023_05_01_preview.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class ApiPortalCustomDomainResource(ProxyResource): """Custom domain of the API portal. @@ -675,7 +657,7 @@ class ApmProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: APM Type. Required. :vartype type: str @@ -727,7 +709,7 @@ def __init__( class ApmReference(_serialization.Model): """A reference to the APM. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of the APM. Required. :vartype resource_id: str @@ -1616,7 +1598,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -1678,7 +1660,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -2567,7 +2549,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2605,7 +2587,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2990,7 +2972,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3062,7 +3044,7 @@ def __init__(self, **kwargs: Any) -> None: class CertificateReference(_serialization.Model): """A reference to the certificate. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of the certificate. Required. :vartype resource_id: str @@ -3312,7 +3294,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -3622,7 +3604,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -3659,7 +3641,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -4005,7 +3987,7 @@ def __init__( self.git_property = git_property -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -4061,7 +4043,7 @@ class ContainerRegistryCredentials(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ContainerRegistryBasicCredentials - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The credential type of the container registry credentials. Required. :vartype type: str @@ -4086,7 +4068,7 @@ def __init__(self, **kwargs: Any) -> None: class ContainerRegistryBasicCredentials(ContainerRegistryCredentials): """The basic authentication properties for the container registry resource. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The credential type of the container registry credentials. Required. :vartype type: str @@ -4133,7 +4115,7 @@ class ContainerRegistryProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar credentials: The credentials of the container registry resource. Required. :vartype credentials: @@ -4273,7 +4255,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -4405,7 +4387,7 @@ def __init__( class CustomContainerUserSourceInfo(UserSourceInfo): """Custom container user source info. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4563,7 +4545,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -4617,7 +4599,7 @@ class CustomizedAcceleratorProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar provisioning_state: State of the customized accelerator. Known values are: "Creating", "Updating", "Succeeded", "Failed", and "Deleting". @@ -4810,7 +4792,7 @@ def __init__( class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -5794,7 +5776,7 @@ class ProbeAction(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ExecAction, HTTPGetAction, TCPSocketAction - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -5822,7 +5804,7 @@ def __init__(self, **kwargs: Any) -> None: class ExecAction(ProbeAction): """ExecAction describes a "run in container" action. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -6783,7 +6765,7 @@ def __init__( class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -6905,7 +6887,7 @@ def __init__(self, *, value: Optional[List[str]] = None, **kwargs: Any) -> None: class HTTPGetAction(ProbeAction): """HTTPGetAction describes an action based on HTTP Get requests. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -7133,7 +7115,7 @@ class UploadedUserSourceInfo(UserSourceInfo): You probably want to use the sub-classes and not this class directly. Known sub-classes are: JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7176,7 +7158,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7232,7 +7214,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -7326,7 +7308,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -7360,7 +7342,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -7814,7 +7796,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -7847,7 +7829,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -8332,7 +8314,7 @@ class Probe(_serialization.Model): """Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive traffic. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar probe_action: The action of the probe. :vartype probe_action: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ProbeAction @@ -8453,7 +8435,7 @@ def __init__( class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2023_05_01_preview.models.TestKeyType @@ -9496,7 +9478,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -9570,7 +9552,7 @@ def __init__(self, *, sku: Optional["_models.Sku"] = None, **kwargs: Any) -> Non class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -9711,7 +9693,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2023_05_01_preview.models.StorageType @@ -9736,7 +9718,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2023_05_01_preview.models.StorageType @@ -10251,7 +10233,7 @@ def __init__( class TCPSocketAction(ProbeAction): """TCPSocketAction describes an action based on opening a socket. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_api_portal_custom_domains_operations.py index 9a2390ca6da..e6fe425ce7e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_api_portals_operations.py index c07e8c544bf..acae9c9e3ae 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -465,20 +438,9 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -524,17 +486,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -555,22 +515,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,11 +539,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -599,14 +554,6 @@ def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -636,7 +583,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,17 +592,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: @@ -666,7 +609,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.ApiPortalResource] @@ -691,17 +633,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -712,14 +653,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -729,11 +670,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -745,10 +686,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload def validate_domain( self, @@ -775,7 +712,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -787,7 +723,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -802,11 +738,10 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -818,7 +753,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -831,13 +766,9 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -867,7 +798,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -876,16 +807,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +827,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_apms_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_apms_operations.py index 5c6ae61b6f1..25439da0396 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_apms_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_apms_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -228,7 +228,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApmResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmResource] @@ -253,17 +252,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -274,14 +272,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApmResourceCollection", pipeline_response) @@ -291,11 +289,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,10 +305,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms" - } - @distributed_trace def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any) -> _models.ApmResource: """Get the APM by name. @@ -322,7 +316,6 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmResource :raises ~azure.core.exceptions.HttpResponseError: @@ -343,22 +336,21 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar ) cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -370,20 +362,16 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> _models.ApmResource: error_map = { @@ -411,7 +399,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(apm_resource, "ApmResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, @@ -420,16 +408,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,10 +436,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } - @overload def begin_create_or_update( self, @@ -478,14 +461,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -499,7 +474,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: IO, + apm_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -514,18 +489,10 @@ def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Required. - :type apm_resource: IO + :type apm_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -539,7 +506,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApmResource]: """Create or update an APM. @@ -552,19 +519,8 @@ def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Is either a ApmResource - type or a IO type. Required. - :type apm_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmResource or IO[bytes] :return: An instance of LROPoller that returns either ApmResource or the result of cls(response) :rtype: @@ -600,7 +556,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -610,17 +566,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApmResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return LROPoller[_models.ApmResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -641,22 +595,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -670,11 +623,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -689,14 +638,6 @@ def begin_delete( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_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: @@ -726,7 +667,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -737,17 +678,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_secret_keys( @@ -762,7 +699,6 @@ def list_secret_keys( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmSecretKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmSecretKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -783,22 +719,21 @@ def list_secret_keys( ) cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None) - request = build_list_secret_keys_request( + _request = build_list_secret_keys_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_secret_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -810,10 +745,6 @@ def list_secret_keys( deserialized = self._deserialize("ApmSecretKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_secret_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_application_accelerators_operations.py index 136cfbf448e..0c5b4c503a4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -204,7 +204,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -230,17 +229,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -251,14 +249,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -268,11 +266,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -284,10 +282,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -301,7 +295,6 @@ def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -322,22 +315,21 @@ def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,20 +341,16 @@ def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -390,7 +378,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -399,16 +387,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,10 +415,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -459,14 +442,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -480,7 +455,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -496,18 +471,10 @@ def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -521,7 +488,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -534,20 +501,9 @@ def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -583,7 +539,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -593,17 +549,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -624,22 +578,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -649,11 +602,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -668,14 +617,6 @@ def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -705,7 +646,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -714,14 +655,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_application_live_views_operations.py index df0001909e3..69663606442 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -198,7 +198,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -224,17 +223,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -245,14 +243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -262,11 +260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -278,10 +276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -295,7 +289,6 @@ def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -316,22 +309,21 @@ def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,20 +335,16 @@ def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -526,20 +493,9 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -616,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_apps_operations.py index 63ac028d757..52f4aa4bc63 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -373,23 +372,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -401,20 +399,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -442,7 +436,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -451,16 +445,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -483,10 +476,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -512,14 +501,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -533,7 +514,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -548,18 +529,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -573,7 +546,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -586,19 +559,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -634,7 +596,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -644,17 +606,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -675,22 +635,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -700,11 +659,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -719,14 +674,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -756,7 +703,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -765,24 +712,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -810,7 +753,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -819,16 +762,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -848,10 +790,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -877,14 +815,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -898,7 +828,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -913,18 +843,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -938,7 +860,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -950,20 +872,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -999,7 +910,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1009,17 +920,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1030,7 +939,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.AppResource] @@ -1055,17 +963,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1076,14 +983,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1093,11 +1000,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1109,10 +1016,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1126,7 +1029,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1147,22 +1049,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,20 +1075,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1215,7 +1112,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1224,16 +1121,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1253,10 +1149,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1283,14 +1175,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1304,7 +1188,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1319,18 +1203,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1344,7 +1220,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1357,20 +1233,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1406,7 +1271,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1416,17 +1281,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1454,7 +1317,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1466,7 +1328,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1481,11 +1343,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1497,7 +1358,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1510,13 +1371,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1546,7 +1403,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1555,16 +1412,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,10 +1432,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_bindings_operations.py index 795cf4693dc..dc880b83f48 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -871,20 +793,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.BindingResource] @@ -981,18 +889,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +910,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1020,11 +927,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1035,7 +942,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_build_service_agent_pool_operations.py index f29633405fa..6a304173ac1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -209,18 +208,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -231,14 +229,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -248,11 +246,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -264,10 +262,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -283,7 +277,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -304,23 +297,22 @@ def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -332,13 +324,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -346,7 +334,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -374,7 +362,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -384,16 +372,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -413,10 +400,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -446,14 +429,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -468,7 +443,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -485,18 +460,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -511,7 +478,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -526,20 +493,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -576,7 +532,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +542,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_build_service_builder_operations.py index 729278c37e8..1618a6dd254 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -261,7 +261,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -282,23 +281,22 @@ def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -310,13 +308,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -324,7 +318,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -352,7 +346,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -362,16 +356,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -391,10 +384,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -423,14 +412,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -445,7 +426,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -462,18 +443,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -488,7 +461,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -503,20 +476,9 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -553,7 +515,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -563,17 +525,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -594,23 +554,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -620,11 +579,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -641,14 +596,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -679,7 +626,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -688,17 +635,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -713,7 +656,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.BuilderResource] @@ -738,18 +680,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -760,14 +701,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -777,11 +718,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,10 +734,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -812,7 +749,6 @@ def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -833,23 +769,22 @@ def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -861,10 +796,6 @@ def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_build_service_operations.py index 9c1a003b15a..97133b908bb 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -607,7 +607,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildService] @@ -632,17 +631,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -653,14 +651,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -670,11 +668,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -686,10 +684,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -703,7 +697,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -724,22 +717,21 @@ def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,20 +743,16 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> _models.BuildService: error_map = { @@ -792,7 +780,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(build_service, "BuildService") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -801,16 +789,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -830,10 +817,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } - @overload def begin_create_or_update( self, @@ -859,14 +842,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -880,7 +855,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: IO, + build_service: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -895,18 +870,10 @@ def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Required. - :type build_service: IO + :type build_service: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -920,7 +887,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildService]: """Create a build service resource. @@ -933,19 +900,9 @@ def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Is either a BuildService type or a - IO type. Required. - :type build_service: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildService or + IO[bytes] :return: An instance of LROPoller that returns either BuildService or the result of cls(response) :rtype: @@ -981,7 +938,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -993,17 +950,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildService].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return LROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_builds( @@ -1018,7 +973,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -1042,18 +996,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1064,14 +1017,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -1081,11 +1034,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1097,10 +1050,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1116,7 +1065,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1137,23 +1085,22 @@ def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1165,13 +1112,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -1201,7 +1144,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1214,7 +1156,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1231,11 +1173,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1248,7 +1189,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -1262,13 +1203,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2023_05_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2023_05_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1298,7 +1235,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1308,16 +1245,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1337,10 +1273,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - def _delete_build_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> None: @@ -1360,23 +1292,22 @@ def _delete_build_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_build_request( + _request = build_delete_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_build_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1390,11 +1321,7 @@ def _delete_build_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_build_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete_build( @@ -1411,14 +1338,6 @@ def begin_delete_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_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: @@ -1449,7 +1368,7 @@ def begin_delete_build( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1460,17 +1379,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_build_results( @@ -1487,7 +1402,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildResult] @@ -1512,19 +1426,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1535,14 +1448,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1552,11 +1465,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1568,10 +1481,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1595,7 +1504,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1616,7 +1524,7 @@ def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1624,16 +1532,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1645,13 +1552,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1676,7 +1579,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1697,7 +1599,7 @@ def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1705,16 +1607,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1726,13 +1627,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1747,7 +1644,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1768,22 +1664,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1795,13 +1690,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1816,7 +1707,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1837,22 +1727,21 @@ def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1864,13 +1753,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1887,7 +1772,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1908,23 +1792,22 @@ def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1936,13 +1819,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1957,7 +1836,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1978,22 +1856,21 @@ def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2005,13 +1882,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -2028,7 +1901,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -2049,23 +1921,22 @@ def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2077,10 +1948,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_buildpack_binding_operations.py index 0af5d7b360f..2070de63fbd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -262,7 +262,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -288,17 +287,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -309,14 +307,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -326,11 +324,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -342,10 +340,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace def get( self, @@ -369,7 +363,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -390,7 +383,7 @@ def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -398,16 +391,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -419,13 +411,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -434,7 +422,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -462,7 +450,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -473,16 +461,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -502,10 +489,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -539,14 +522,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -562,7 +537,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -582,18 +557,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -609,7 +576,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -626,20 +593,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -677,7 +633,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -687,17 +643,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -724,7 +678,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -732,16 +686,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,11 +704,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -780,14 +729,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -819,7 +760,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -828,17 +769,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -855,7 +792,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -881,19 +817,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -904,14 +839,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -921,11 +856,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -936,7 +871,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_certificates_operations.py index 15a7ccd7b12..7e164ee842f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -493,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -524,22 +484,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -549,11 +508,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -568,14 +523,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -605,7 +552,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -614,17 +561,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -637,7 +580,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.CertificateResource] @@ -662,17 +604,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -683,14 +624,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -700,11 +641,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -715,7 +656,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_config_servers_operations.py index 2cdec93b9cc..ee5cc08c207 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -474,23 +436,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -518,7 +478,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -526,16 +486,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,10 +514,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -582,14 +537,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -602,7 +549,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -615,18 +562,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -639,7 +578,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -650,20 +589,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -698,7 +626,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -708,23 +636,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -752,7 +678,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -760,16 +686,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -789,10 +714,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -816,14 +737,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -836,7 +749,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -849,18 +762,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -873,7 +778,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -884,20 +789,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -932,7 +826,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -944,14 +838,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_configuration_services_operations.py index 179885f23e2..7af88ee566e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -393,14 +382,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -414,7 +395,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -430,18 +411,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -469,20 +442,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -559,22 +519,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,11 +543,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -603,14 +558,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -640,7 +587,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -649,17 +596,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -672,7 +615,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -698,17 +640,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -719,14 +660,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -736,11 +677,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -752,16 +693,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -789,7 +726,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -798,16 +735,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -827,10 +763,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -856,14 +788,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -877,7 +801,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -892,18 +816,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -917,7 +833,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -930,20 +846,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -979,7 +884,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -991,14 +896,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_container_registries_operations.py index 55d8eb8cb6f..3da43980139 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_container_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_container_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -241,7 +241,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContainerRegistryResource or the result of cls(response) :rtype: @@ -267,17 +266,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -288,14 +286,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) @@ -305,11 +303,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +319,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -338,7 +332,6 @@ def get( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ContainerRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -359,22 +352,21 @@ def get( ) cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -386,20 +378,16 @@ def get( deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> _models.ContainerRegistryResource: error_map = { @@ -427,7 +415,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -436,16 +424,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -465,10 +452,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } - @overload def begin_create_or_update( self, @@ -495,14 +478,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -516,7 +491,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: IO, + container_registry_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -531,18 +506,10 @@ def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Required. - :type container_registry_resource: IO + :type container_registry_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -556,7 +523,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ContainerRegistryResource]: """Create or update container registry resource. @@ -569,20 +536,9 @@ def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Is either a - ContainerRegistryResource type or a IO type. Required. + ContainerRegistryResource type or a IO[bytes] type. Required. :type container_registry_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ContainerRegistryResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ContainerRegistryResource or IO[bytes] :return: An instance of LROPoller that returns either ContainerRegistryResource or the result of cls(response) :rtype: @@ -618,7 +574,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -630,17 +586,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ContainerRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return LROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -661,22 +615,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -690,11 +643,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -709,14 +658,6 @@ def begin_delete( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_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: @@ -746,7 +687,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -757,24 +698,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _validate_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.ContainerRegistryValidateResult]: error_map = { @@ -802,7 +739,7 @@ def _validate_initial( else: _json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -811,16 +748,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -838,13 +774,9 @@ def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return deserialized # type: ignore @overload def begin_validate( @@ -872,14 +804,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -893,7 +817,7 @@ def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: IO, + container_registry_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -908,18 +832,10 @@ def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Required. - :type container_registry_properties: IO + :type container_registry_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -933,7 +849,7 @@ def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ContainerRegistryValidateResult]: """Check if the container registry properties are valid. @@ -946,20 +862,9 @@ def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Is either a - ContainerRegistryProperties type or a IO type. Required. + ContainerRegistryProperties type or a IO[bytes] type. Required. :type container_registry_properties: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.ContainerRegistryProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.ContainerRegistryProperties or IO[bytes] :return: An instance of LROPoller that returns either ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -995,7 +900,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1007,14 +912,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ContainerRegistryValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return LROPoller[_models.ContainerRegistryValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_custom_domains_operations.py index 386ef8b0734..fe578613482 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -871,20 +793,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -982,18 +890,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1004,14 +911,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1021,11 +928,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,7 +943,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_customized_accelerators_operations.py index 0b685652ea5..05e1d3bcf42 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -272,7 +272,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -298,18 +297,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -320,14 +318,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -337,11 +335,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +351,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace def get( self, @@ -377,7 +371,6 @@ def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -398,23 +391,22 @@ def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,13 +418,9 @@ def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -440,7 +428,7 @@ def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -468,7 +456,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -478,16 +466,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -507,10 +494,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -541,14 +524,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -563,7 +538,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +556,10 @@ def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -607,7 +574,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -622,20 +589,9 @@ def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -672,7 +628,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -682,17 +638,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -718,23 +672,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -744,11 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -770,14 +719,6 @@ def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -808,7 +749,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -817,17 +758,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def validate( @@ -858,7 +795,6 @@ def validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -872,7 +808,7 @@ def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -889,11 +825,10 @@ def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -907,7 +842,7 @@ def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -922,13 +857,9 @@ def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -959,7 +890,7 @@ def validate( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -969,16 +900,15 @@ def validate( content_type=content_type, json=_json, content=_content, - template_url=self.validate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -992,10 +922,6 @@ def validate( deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_deployments_operations.py index ccf9b6a63ec..1ef99392f70 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -468,7 +468,7 @@ def build_disable_remote_debugging_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_remote_debugging_config_request( +def build_get_remote_debugging_config_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, app_name: str, @@ -702,7 +702,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -723,23 +722,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,13 +749,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -765,7 +759,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -793,7 +787,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -803,16 +797,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -835,10 +828,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -868,14 +857,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -890,7 +871,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -907,18 +888,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -933,7 +906,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -948,20 +921,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -998,7 +960,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1008,17 +970,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1039,23 +999,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1065,11 +1024,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -1086,14 +1041,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1124,7 +1071,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1133,17 +1080,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1151,7 +1094,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1179,7 +1122,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1189,16 +1132,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1218,10 +1160,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1251,14 +1189,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1273,7 +1203,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1290,18 +1220,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1316,7 +1238,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1331,20 +1253,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1381,7 +1292,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1391,17 +1302,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1423,7 +1332,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentResource] @@ -1448,19 +1356,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1471,14 +1378,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1488,11 +1395,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1504,10 +1411,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1521,7 +1424,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.DeploymentResource] @@ -1546,18 +1448,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1568,14 +1469,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1585,11 +1486,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1601,10 +1502,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1624,23 +1521,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1650,11 +1546,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1671,14 +1563,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1709,7 +1593,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1718,17 +1602,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1749,23 +1629,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1775,11 +1654,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1796,14 +1671,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1834,7 +1701,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1843,17 +1710,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1874,23 +1737,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1900,11 +1762,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1921,14 +1779,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1959,7 +1809,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1968,17 +1818,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_remote_debugging_initial( self, @@ -1986,7 +1832,7 @@ def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -2017,7 +1863,7 @@ def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2027,16 +1873,15 @@ def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2056,10 +1901,6 @@ def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload def begin_enable_remote_debugging( self, @@ -2089,14 +1930,6 @@ def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2111,7 +1944,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2128,18 +1961,10 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2154,7 +1979,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> LROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -2169,20 +1994,9 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of LROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -2219,7 +2033,7 @@ def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2229,17 +2043,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2260,23 +2072,22 @@ def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2296,10 +2107,6 @@ def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2315,14 +2122,6 @@ def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -2356,7 +2155,7 @@ def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2366,17 +2165,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def get_remote_debugging_config( @@ -2393,7 +2190,6 @@ def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -2414,23 +2210,22 @@ def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2442,13 +2237,9 @@ def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace def get_log_file_url( @@ -2465,7 +2256,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -2486,23 +2276,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2516,13 +2305,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2530,7 +2315,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2558,7 +2343,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2568,16 +2353,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2587,11 +2371,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2622,14 +2402,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2642,7 +2414,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2659,18 +2431,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2683,7 +2447,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2698,20 +2462,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2745,7 +2498,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2754,17 +2507,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2772,7 +2521,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2800,7 +2549,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2810,16 +2559,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2829,11 +2577,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2864,14 +2608,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2884,7 +2620,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2901,18 +2637,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2925,7 +2653,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2940,20 +2668,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2987,7 +2704,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2996,17 +2713,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -3014,7 +2727,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -3042,7 +2755,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -3052,16 +2765,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -3071,11 +2783,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -3106,14 +2814,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -3126,7 +2826,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -3143,18 +2843,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -3167,7 +2859,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -3182,20 +2874,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -3229,7 +2910,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3238,14 +2919,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_dev_tool_portals_operations.py index 3dc33632e5d..ed9119c946e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -198,7 +198,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -224,17 +223,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -245,14 +243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -262,11 +260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -278,10 +276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -295,7 +289,6 @@ def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -316,22 +309,21 @@ def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,20 +335,16 @@ def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -526,20 +493,9 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of LROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -616,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_eureka_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_eureka_servers_operations.py index 672de76eda6..32be69f015a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_eureka_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_eureka_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -194,7 +194,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResourceCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.EurekaServerResourceCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -215,21 +214,20 @@ def list( ) cls: ClsType[_models.EurekaServerResourceCollection] = kwargs.pop("cls", None) - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -241,13 +239,9 @@ def list( deserialized = self._deserialize("EurekaServerResourceCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers" - } + return deserialized # type: ignore @distributed_trace def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.EurekaServerResource: @@ -258,7 +252,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.EurekaServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -279,21 +272,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -305,19 +297,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -345,7 +333,7 @@ def _update_put_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -353,16 +341,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -385,10 +372,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload def begin_update_put( self, @@ -412,14 +395,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -432,7 +407,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -445,18 +420,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -469,7 +436,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -480,20 +447,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of LROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -528,7 +484,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -540,23 +496,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return LROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -584,7 +538,7 @@ def _update_patch_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -592,16 +546,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -624,10 +577,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload def begin_update_patch( self, @@ -651,14 +600,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -671,7 +612,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -684,18 +625,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -708,7 +641,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -719,20 +652,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of LROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -767,7 +689,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -779,14 +701,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return LROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_gateway_custom_domains_operations.py index dd96bf66119..5f5075f2328 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_gateway_route_configs_operations.py index abbb1060ba7..8b5af66aed3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload def begin_create_or_update( self, @@ -388,14 +377,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -410,7 +391,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -429,18 +410,10 @@ def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -471,20 +444,9 @@ def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -521,7 +483,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -531,17 +493,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -562,23 +522,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,11 +547,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -609,14 +564,6 @@ def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -647,7 +594,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -656,17 +603,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -681,7 +624,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -707,18 +649,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -729,14 +670,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -746,11 +687,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -761,7 +702,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_gateways_operations.py index 8471c272c8b..505db7572c9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -334,7 +334,6 @@ def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -355,22 +354,21 @@ def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -382,20 +380,16 @@ def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -423,7 +417,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -432,16 +426,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -461,10 +454,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload def begin_create_or_update( self, @@ -490,14 +479,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -511,7 +492,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -526,18 +507,10 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -551,7 +524,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -564,20 +537,9 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -613,7 +575,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -623,24 +585,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_capacity_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> Optional[_models.GatewayResource]: error_map = { @@ -668,7 +628,7 @@ def _update_capacity_initial( else: _json = self._serialize.body(gateway_capacity_resource, "SkuObject") - request = build_update_capacity_request( + _request = build_update_capacity_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -677,16 +637,15 @@ def _update_capacity_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_capacity_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -704,13 +663,9 @@ def _update_capacity_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_capacity_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore @overload def begin_update_capacity( @@ -737,14 +692,6 @@ def begin_update_capacity( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -758,7 +705,7 @@ def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: IO, + gateway_capacity_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -773,18 +720,10 @@ def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Required. - :type gateway_capacity_resource: IO + :type gateway_capacity_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -798,7 +737,7 @@ def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Operation to update an exiting Spring Cloud Gateway capacity. @@ -811,20 +750,9 @@ def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a - SkuObject type or a IO type. Required. + SkuObject type or a IO[bytes] type. Required. :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.SkuObject - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -860,7 +788,7 @@ def begin_update_capacity( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -872,17 +800,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_capacity.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -903,22 +829,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -928,11 +853,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -947,14 +868,6 @@ def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -984,7 +897,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -993,17 +906,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_env_secrets( @@ -1018,7 +927,6 @@ def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -1039,22 +947,21 @@ def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1066,13 +973,9 @@ def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -1093,22 +996,21 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1122,11 +1024,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_restart( @@ -1141,14 +1039,6 @@ def begin_restart( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -1178,7 +1068,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1189,17 +1079,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: @@ -1210,7 +1096,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.GatewayResource] @@ -1235,17 +1120,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1256,14 +1140,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -1273,11 +1157,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1289,10 +1173,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload def validate_domain( self, @@ -1319,7 +1199,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1331,7 +1210,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1346,11 +1225,10 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1362,7 +1240,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -1375,13 +1253,9 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1411,7 +1285,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1420,16 +1294,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1441,10 +1314,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_monitoring_settings_operations.py index 8e3c8f0daab..5744ed80096 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -440,23 +402,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -484,7 +444,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -492,16 +452,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -521,10 +480,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -548,14 +503,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -568,7 +515,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +528,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -605,7 +544,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -616,20 +555,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_05_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -664,7 +592,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -674,14 +602,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_operations.py index cb5abbf6c1d..1837faab004 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_predefined_accelerators_operations.py index d32d8ce43cf..db5d746d558 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -225,7 +225,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -251,18 +250,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -273,14 +271,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -290,11 +288,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +304,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace def get( self, @@ -330,7 +324,6 @@ def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -351,23 +344,22 @@ def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -379,13 +371,9 @@ def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -411,23 +399,22 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +424,7 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_disable( @@ -463,14 +446,6 @@ def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -501,7 +476,7 @@ def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -510,17 +485,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -546,23 +517,22 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -572,11 +542,7 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_enable( @@ -598,14 +564,6 @@ def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -636,7 +594,7 @@ def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,14 +603,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_runtime_versions_operations.py index acf850ae017..45b4e0c5af0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_service_registries_operations.py index 76194d22733..f712d829a75 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -217,22 +216,21 @@ def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,13 +242,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -271,22 +265,21 @@ def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +299,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -323,14 +312,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -373,17 +354,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -404,22 +383,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,11 +407,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -448,14 +422,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -485,7 +451,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -494,17 +460,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -517,7 +479,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -543,17 +504,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -581,11 +541,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +556,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_services_operations.py index 2254db9bf1d..86974095cf5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -596,7 +596,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -617,21 +616,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -643,16 +641,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -679,7 +677,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -687,16 +685,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -719,10 +716,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -745,14 +738,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -765,7 +750,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -778,18 +763,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -799,7 +776,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -809,19 +790,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -856,7 +826,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -866,17 +836,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -897,21 +865,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -921,11 +888,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -936,14 +899,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -972,7 +927,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -981,20 +936,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -1021,7 +976,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1029,16 +984,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1058,10 +1012,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -1084,14 +1034,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1104,7 +1046,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1117,18 +1059,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1138,7 +1072,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1147,20 +1085,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1195,7 +1122,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1205,17 +1132,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1226,7 +1151,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1247,21 +1171,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1273,13 +1196,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1304,7 +1223,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1315,7 +1233,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1328,11 +1246,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1343,7 +1260,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1354,13 +1271,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_05_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1390,7 +1303,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1398,16 +1311,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1419,13 +1331,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1438,7 +1346,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1459,21 +1366,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1483,11 +1389,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1498,7 +1400,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1519,21 +1420,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1545,13 +1445,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1572,35 +1468,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1611,14 +1502,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1647,7 +1530,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1656,17 +1539,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1687,35 +1566,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1726,14 +1600,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1762,7 +1628,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1771,17 +1637,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_supported_apm_types( @@ -1794,7 +1656,6 @@ def list_supported_apm_types( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedApmType or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.SupportedApmType] @@ -1819,17 +1680,16 @@ def list_supported_apm_types( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_apm_types_request( + _request = build_list_supported_apm_types_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_apm_types.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1840,14 +1700,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("SupportedApmTypes", pipeline_response) @@ -1857,11 +1717,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1873,10 +1733,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_supported_apm_types.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes" - } - @distributed_trace def list_globally_enabled_apms( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1888,7 +1744,6 @@ def list_globally_enabled_apms( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GloballyEnabledApms or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.GloballyEnabledApms :raises ~azure.core.exceptions.HttpResponseError: @@ -1909,21 +1764,20 @@ def list_globally_enabled_apms( ) cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None) - request = build_list_globally_enabled_apms_request( + _request = build_list_globally_enabled_apms_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_globally_enabled_apms.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1935,16 +1789,12 @@ def list_globally_enabled_apms( deserialized = self._deserialize("GloballyEnabledApms", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_globally_enabled_apms.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms" - } + return deserialized # type: ignore def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1971,7 +1821,7 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme else: _json = self._serialize.body(apm, "ApmReference") - request = build_enable_apm_globally_request( + _request = build_enable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1979,16 +1829,15 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme content_type=content_type, json=_json, content=_content, - template_url=self._enable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2002,11 +1851,7 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload def begin_enable_apm_globally( @@ -2030,14 +1875,6 @@ def begin_enable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2048,7 +1885,7 @@ def begin_enable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2061,18 +1898,10 @@ def begin_enable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the enable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2080,7 +1909,7 @@ def begin_enable_apm_globally( @distributed_trace def begin_enable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Enable an APM globally. @@ -2089,20 +1918,9 @@ def begin_enable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the enable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the enable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmReference or IO[bytes] :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: @@ -2134,7 +1952,7 @@ def begin_enable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2145,20 +1963,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -2185,7 +1999,7 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(apm, "ApmReference") - request = build_disable_apm_globally_request( + _request = build_disable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -2193,16 +2007,15 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._disable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2216,11 +2029,7 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload def begin_disable_apm_globally( @@ -2244,14 +2053,6 @@ def begin_disable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2262,7 +2063,7 @@ def begin_disable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2275,18 +2076,10 @@ def begin_disable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the disable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2294,7 +2087,7 @@ def begin_disable_apm_globally( @distributed_trace def begin_disable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Disable an APM globally. @@ -2303,20 +2096,9 @@ def begin_disable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the disable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the disable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_05_01_preview.models.ApmReference or IO[bytes] :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: @@ -2348,7 +2130,7 @@ def begin_disable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2359,17 +2141,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -2390,7 +2168,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2398,18 +2175,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2417,20 +2198,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2023_05_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_05_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2460,23 +2240,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2488,19 +2267,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceResource] @@ -2525,15 +2299,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2544,14 +2317,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2561,11 +2334,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2577,8 +2350,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -2586,7 +2357,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.ServiceResource] @@ -2611,16 +2381,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2631,14 +2400,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2648,11 +2417,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2663,7 +2432,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_skus_operations.py index 37ef3644fdf..8d31dd294e7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_storages_operations.py index 39d59365490..fb1aec12a70 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_05_01_preview/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_05_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -359,14 +348,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -380,7 +361,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -395,18 +376,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -420,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -433,20 +406,9 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2023_05_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -482,7 +444,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -492,17 +454,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -523,22 +483,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +507,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -567,14 +522,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -604,7 +551,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -613,17 +560,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -634,7 +577,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_05_01_preview.models.StorageResource] @@ -659,17 +601,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -680,14 +621,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -697,11 +638,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -712,7 +653,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/_app_platform_management_client.py index acfc7c18620..8372d6d2db4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -166,7 +168,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -260,7 +280,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2023-07-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -280,7 +300,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/_configuration.py index 26999226dd6..930b865f49e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-07-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/_app_platform_management_client.py index de1ddf74f83..ea33a66f17c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -166,7 +168,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -260,7 +280,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2023-07-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -280,7 +302,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/_configuration.py index 81ef010f5cd..12fe67c620d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-07-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_api_portal_custom_domains_operations.py index 41168d44d16..07ff3f4f808 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_api_portals_operations.py index 5c6427783ec..9b3a8e78fec 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -365,17 +327,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -396,22 +356,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -440,14 +395,6 @@ async def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -477,7 +424,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -486,17 +433,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -509,7 +452,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.ApiPortalResource] @@ -534,17 +476,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -555,14 +496,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -572,11 +513,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +529,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload async def validate_domain( self, @@ -618,7 +555,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -630,7 +566,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -645,11 +581,10 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -661,7 +596,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -674,13 +609,9 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -710,7 +641,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -719,16 +650,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,10 +670,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_apms_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_apms_operations.py index 736115c83a4..61e323a8676 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_apms_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_apms_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -72,7 +72,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApmResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmResource] @@ -97,17 +96,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -118,14 +116,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApmResourceCollection", pipeline_response) @@ -135,11 +133,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -151,10 +149,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -168,7 +162,6 @@ async def get( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmResource :raises ~azure.core.exceptions.HttpResponseError: @@ -189,22 +182,21 @@ async def get( ) cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -216,20 +208,16 @@ async def get( deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> _models.ApmResource: error_map = { @@ -257,7 +245,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(apm_resource, "ApmResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, @@ -266,16 +254,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -295,10 +282,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } - @overload async def begin_create_or_update( self, @@ -324,14 +307,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -345,7 +320,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: IO, + apm_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -360,18 +335,10 @@ async def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Required. - :type apm_resource: IO + :type apm_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -385,7 +352,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApmResource]: """Create or update an APM. @@ -398,19 +365,8 @@ async def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Is either a ApmResource - type or a IO type. Required. - :type apm_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApmResource or the result of cls(response) :rtype: @@ -446,7 +402,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -456,17 +412,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApmResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return AsyncLROPoller[_models.ApmResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -487,22 +441,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -583,17 +524,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_secret_keys( @@ -608,7 +545,6 @@ async def list_secret_keys( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmSecretKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmSecretKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -629,22 +565,21 @@ async def list_secret_keys( ) cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None) - request = build_list_secret_keys_request( + _request = build_list_secret_keys_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_secret_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -656,10 +591,6 @@ async def list_secret_keys( deserialized = self._deserialize("ApmSecretKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_secret_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_application_accelerators_operations.py index 88478b885f7..22766114723 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -328,14 +311,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -349,7 +324,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -365,18 +340,10 @@ async def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -390,7 +357,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -403,20 +370,9 @@ async def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -452,7 +408,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -462,17 +418,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -493,22 +447,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -518,11 +471,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -537,14 +486,6 @@ async def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -574,7 +515,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -583,14 +524,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_application_live_views_operations.py index d39e920e24c..f08c0161704 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -581,14 +522,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_apps_operations.py index 5729afe720e..0d2cd60074a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,20 +133,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -176,7 +170,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -185,16 +179,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -217,10 +210,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -246,14 +235,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -267,7 +248,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -320,19 +293,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -368,7 +330,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -378,17 +340,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -409,22 +369,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,11 +393,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -453,14 +408,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -490,7 +437,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -499,24 +446,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -544,7 +487,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -553,16 +496,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,10 +524,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -611,14 +549,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -632,7 +562,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -647,18 +577,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -672,7 +594,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -684,20 +606,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -733,7 +644,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -743,17 +654,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -764,7 +673,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.AppResource] @@ -789,17 +697,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -810,14 +717,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -827,11 +734,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -843,10 +750,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -860,7 +763,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -881,22 +783,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -908,20 +809,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -949,7 +846,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -958,16 +855,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -987,10 +883,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -1017,14 +909,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1038,7 +922,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1053,18 +937,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1078,7 +954,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1091,20 +967,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1140,7 +1005,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1150,17 +1015,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1188,7 +1051,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1200,7 +1062,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1215,11 +1077,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1231,7 +1092,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1244,13 +1105,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1280,7 +1137,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1289,16 +1146,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1310,10 +1166,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_bindings_operations.py index 6482dc0d9a7..c3e8c314736 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -705,20 +627,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.BindingResource] @@ -815,18 +723,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -837,14 +744,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -854,11 +761,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -869,7 +776,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_build_service_agent_pool_operations.py index 2bceeedc456..14a7d8b2dba 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -174,7 +168,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -195,23 +188,22 @@ async def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -223,13 +215,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -237,7 +225,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -265,7 +253,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -275,16 +263,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -304,10 +291,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -337,14 +320,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -359,7 +334,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +351,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -402,7 +369,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -417,20 +384,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -467,7 +423,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -477,14 +433,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_build_service_builder_operations.py index aae1606d2da..7a8d12a0dc6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,10 +201,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -240,14 +229,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -262,7 +243,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -279,18 +260,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -305,7 +278,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -320,20 +293,9 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -370,7 +332,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -380,17 +342,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -411,23 +371,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +396,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -458,14 +413,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -496,7 +443,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -505,17 +452,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -530,7 +473,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.BuilderResource] @@ -555,18 +497,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -577,14 +518,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -594,11 +535,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -610,10 +551,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace_async async def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -629,7 +566,6 @@ async def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -650,23 +586,22 @@ async def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -678,10 +613,6 @@ async def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_build_service_operations.py index 94551ebb2aa..17ca5f9755d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildService] @@ -109,17 +108,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -130,14 +128,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -147,11 +145,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -163,10 +161,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -180,7 +174,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -201,22 +194,21 @@ async def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,20 +220,16 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> _models.BuildService: error_map = { @@ -269,7 +257,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(build_service, "BuildService") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -278,16 +266,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,10 +294,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } - @overload async def begin_create_or_update( self, @@ -336,14 +319,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -357,7 +332,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: IO, + build_service: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -372,18 +347,10 @@ async def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Required. - :type build_service: IO + :type build_service: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -397,7 +364,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildService]: """Create a build service resource. @@ -410,19 +377,9 @@ async def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Is either a BuildService type or a - IO type. Required. - :type build_service: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildService or + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildService or the result of cls(response) :rtype: @@ -458,7 +415,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -470,17 +427,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildService].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return AsyncLROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_builds( @@ -495,7 +450,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.Build] @@ -520,18 +474,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -542,14 +495,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -559,11 +512,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -575,10 +528,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -594,7 +543,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -615,23 +563,22 @@ async def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -643,13 +590,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -679,7 +622,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -692,7 +634,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -709,11 +651,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -726,7 +667,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -740,13 +681,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2023_07_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2023_07_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -776,7 +713,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -786,16 +723,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -815,10 +751,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - async def _delete_build_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> None: @@ -838,23 +770,22 @@ async def _delete_build_initial( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_build_request( + _request = build_delete_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_build_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -868,11 +799,7 @@ async def _delete_build_initial( # pylint: disable=inconsistent-return-statemen response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_build_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete_build( @@ -889,14 +816,6 @@ async def begin_delete_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_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: @@ -927,7 +846,7 @@ async def begin_delete_build( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -938,17 +857,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_build_results( @@ -965,7 +880,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildResult] @@ -990,19 +904,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1013,14 +926,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1030,11 +943,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1046,10 +959,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -1073,7 +982,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1094,7 +1002,7 @@ async def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1102,16 +1010,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1123,13 +1030,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -1154,7 +1057,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1175,7 +1077,7 @@ async def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1183,16 +1085,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1204,13 +1105,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -1225,7 +1122,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1246,22 +1142,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1273,13 +1168,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -1294,7 +1185,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1315,22 +1205,21 @@ async def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1342,13 +1231,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -1365,7 +1250,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1386,23 +1270,22 @@ async def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1414,13 +1297,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1435,7 +1314,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1456,22 +1334,21 @@ async def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1483,13 +1360,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1506,7 +1379,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1527,23 +1399,22 @@ async def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1555,10 +1426,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_buildpack_binding_operations.py index 3c68984e003..d9c0137c67d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -100,17 +99,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -121,14 +119,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -138,11 +136,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,10 +152,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,7 +195,7 @@ async def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -210,16 +203,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -231,13 +223,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -246,7 +234,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -274,7 +262,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -285,16 +273,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -314,10 +301,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -351,14 +334,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -374,7 +349,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -394,18 +369,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -421,7 +388,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -438,20 +405,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -489,7 +445,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -499,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -536,7 +490,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -544,16 +498,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -563,11 +516,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -592,14 +541,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -631,7 +572,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -640,17 +581,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -667,7 +604,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -693,19 +629,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -716,14 +651,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -733,11 +668,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -748,7 +683,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_certificates_operations.py index 13be68e219e..955ce48f7bc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,17 +330,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -399,22 +359,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,11 +383,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -443,14 +398,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -489,17 +436,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -512,7 +455,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.CertificateResource] @@ -537,17 +479,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -558,14 +499,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -575,11 +516,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -590,7 +531,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_config_servers_operations.py index d76f1a9fb18..b868f56573d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -345,23 +307,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -389,7 +349,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -397,16 +357,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,10 +385,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -453,14 +408,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -473,7 +420,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -486,18 +433,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -510,7 +449,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -521,20 +460,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -569,7 +497,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -579,23 +507,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -623,7 +549,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -631,16 +557,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -660,10 +585,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -687,14 +608,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -707,7 +620,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -720,18 +633,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -744,7 +649,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -755,20 +660,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -803,7 +697,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -815,14 +709,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_configuration_services_operations.py index ef97289ffc8..352a3ae443c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,22 +97,21 @@ async def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,20 +123,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -166,7 +160,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -204,10 +197,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -272,18 +253,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -297,7 +270,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -311,20 +284,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -360,7 +322,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -370,17 +332,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -401,22 +361,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,11 +385,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -445,14 +400,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -482,7 +429,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -491,17 +438,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -514,7 +457,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -540,17 +482,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -561,14 +502,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -578,11 +519,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -594,16 +535,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -631,7 +568,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -640,16 +577,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -669,10 +605,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -698,14 +630,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -719,7 +643,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -734,18 +658,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -759,7 +675,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -772,20 +688,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -821,7 +726,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -833,24 +738,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_resource_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> Optional[_models.ConfigurationServiceSettingsValidateResult]: error_map = { @@ -878,7 +781,7 @@ async def _validate_resource_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_validate_resource_request( + _request = build_validate_resource_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -887,16 +790,15 @@ async def _validate_resource_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_resource_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -914,13 +816,9 @@ async def _validate_resource_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _validate_resource_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return deserialized # type: ignore @overload async def begin_validate_resource( @@ -949,14 +847,6 @@ async def begin_validate_resource( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -970,7 +860,7 @@ async def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -986,18 +876,10 @@ async def begin_validate_resource( :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be validated. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1011,7 +893,7 @@ async def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service resource is valid. @@ -1024,20 +906,9 @@ async def begin_validate_resource( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be - validated. Is either a ConfigurationServiceResource type or a IO type. Required. + validated. Is either a ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1073,7 +944,7 @@ async def begin_validate_resource( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1085,14 +956,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_resource.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_container_registries_operations.py index 53af757fb07..45127d74ec9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_container_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_container_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContainerRegistryResource or the result of cls(response) :rtype: @@ -100,17 +99,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -121,14 +119,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) @@ -138,11 +136,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,10 +152,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -171,7 +165,6 @@ async def get( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ContainerRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -192,22 +185,21 @@ async def get( ) cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -219,20 +211,16 @@ async def get( deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> _models.ContainerRegistryResource: error_map = { @@ -260,7 +248,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -269,16 +257,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -298,10 +285,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } - @overload async def begin_create_or_update( self, @@ -328,14 +311,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -349,7 +324,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: IO, + container_registry_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -364,18 +339,10 @@ async def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Required. - :type container_registry_resource: IO + :type container_registry_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -389,7 +356,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ContainerRegistryResource]: """Create or update container registry resource. @@ -402,20 +369,9 @@ async def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Is either a - ContainerRegistryResource type or a IO type. Required. + ContainerRegistryResource type or a IO[bytes] type. Required. :type container_registry_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ContainerRegistryResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ContainerRegistryResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the result of cls(response) :rtype: @@ -451,7 +407,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -463,17 +419,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ContainerRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return AsyncLROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -494,22 +448,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -523,11 +476,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -542,14 +491,6 @@ async def begin_delete( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_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: @@ -579,7 +520,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -590,24 +531,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _validate_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.ContainerRegistryValidateResult]: error_map = { @@ -635,7 +572,7 @@ async def _validate_initial( else: _json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -644,16 +581,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -671,13 +607,9 @@ async def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return deserialized # type: ignore @overload async def begin_validate( @@ -705,14 +637,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -726,7 +650,7 @@ async def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: IO, + container_registry_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -741,18 +665,10 @@ async def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Required. - :type container_registry_properties: IO + :type container_registry_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -766,7 +682,7 @@ async def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]: """Check if the container registry properties are valid. @@ -779,20 +695,9 @@ async def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Is either a - ContainerRegistryProperties type or a IO type. Required. + ContainerRegistryProperties type or a IO[bytes] type. Required. :type container_registry_properties: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ContainerRegistryProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ContainerRegistryProperties or IO[bytes] :return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -828,7 +733,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -840,14 +745,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ContainerRegistryValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return AsyncLROPoller[_models.ContainerRegistryValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_custom_domains_operations.py index c061eca9a25..1b633e859da 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -705,20 +627,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -816,18 +724,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -838,14 +745,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -855,11 +762,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -870,7 +777,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_customized_accelerators_operations.py index 9234f038448..eae9a310d9a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -102,18 +101,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -124,14 +122,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -141,11 +139,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,10 +155,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,23 +195,22 @@ async def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -230,13 +222,9 @@ async def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -244,7 +232,7 @@ async def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -272,7 +260,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -282,16 +270,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -311,10 +298,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -345,14 +328,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -367,7 +342,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -385,18 +360,10 @@ async def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -411,7 +378,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -426,20 +393,9 @@ async def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -476,7 +432,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -486,17 +442,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -522,23 +476,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +501,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -574,14 +523,6 @@ async def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -612,7 +553,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -621,17 +562,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def validate( @@ -662,7 +599,6 @@ async def validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -676,7 +612,7 @@ async def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -693,11 +629,10 @@ async def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -711,7 +646,7 @@ async def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -726,13 +661,9 @@ async def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -763,7 +694,7 @@ async def validate( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -773,16 +704,15 @@ async def validate( content_type=content_type, json=_json, content=_content, - template_url=self.validate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -796,10 +726,6 @@ async def validate( deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_deployments_operations.py index b34da4f9196..2bdf27af1e4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -89,7 +89,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -110,23 +109,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -138,13 +136,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -152,7 +146,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -180,7 +174,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -190,16 +184,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -222,10 +215,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -255,14 +244,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -277,7 +258,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -294,18 +275,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -320,7 +293,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -335,20 +308,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -385,7 +347,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -395,17 +357,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -426,23 +386,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -452,11 +411,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -473,14 +428,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -511,7 +458,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -520,17 +467,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -538,7 +481,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -566,7 +509,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -576,16 +519,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -605,10 +547,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -638,14 +576,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -660,7 +590,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -677,18 +607,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -703,7 +625,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -718,20 +640,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -768,7 +679,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -778,17 +689,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -810,7 +719,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentResource] @@ -835,19 +743,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -858,14 +765,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -875,11 +782,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -891,10 +798,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -908,7 +811,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentResource] @@ -933,18 +835,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -955,14 +856,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -972,11 +873,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -988,10 +889,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1011,23 +908,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1037,11 +933,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1058,14 +950,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1096,7 +980,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1105,17 +989,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1136,23 +1016,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1162,11 +1041,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1183,14 +1058,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1221,7 +1088,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1230,17 +1097,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1261,23 +1124,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1287,11 +1149,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1308,14 +1166,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1346,7 +1196,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1355,17 +1205,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_remote_debugging_initial( self, @@ -1373,7 +1219,7 @@ async def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -1404,7 +1250,7 @@ async def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1414,16 +1260,15 @@ async def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1443,10 +1288,6 @@ async def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload async def begin_enable_remote_debugging( self, @@ -1476,14 +1317,6 @@ async def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1498,7 +1331,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1515,18 +1348,10 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1541,7 +1366,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> AsyncLROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -1556,20 +1381,9 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -1606,7 +1420,7 @@ async def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1616,17 +1430,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1647,23 +1459,22 @@ async def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1683,10 +1494,6 @@ async def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace_async async def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1702,14 +1509,6 @@ async def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -1743,7 +1542,7 @@ async def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1753,17 +1552,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def get_remote_debugging_config( @@ -1780,7 +1577,6 @@ async def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -1801,23 +1597,22 @@ async def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1829,13 +1624,9 @@ async def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1852,7 +1643,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1873,23 +1663,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1903,13 +1692,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1917,7 +1702,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1945,7 +1730,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1955,16 +1740,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1974,11 +1758,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -2009,14 +1789,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2029,7 +1801,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2046,18 +1818,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2070,7 +1834,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -2085,20 +1849,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2132,7 +1885,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2141,17 +1894,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2159,7 +1908,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2187,7 +1936,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2197,16 +1946,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2216,11 +1964,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -2251,14 +1995,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2271,7 +2007,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2288,18 +2024,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2312,7 +2040,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -2327,20 +2055,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2374,7 +2091,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2383,17 +2100,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2401,7 +2114,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2429,7 +2142,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2439,16 +2152,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2458,11 +2170,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2493,14 +2201,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2513,7 +2213,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2530,18 +2230,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2554,7 +2246,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2569,20 +2261,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2616,7 +2297,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2625,14 +2306,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_dev_tool_portals_operations.py index ca8d3b73725..5674cbbea55 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -581,14 +522,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_eureka_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_eureka_servers_operations.py index 177a82578ec..d52d024b429 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_eureka_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_eureka_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -70,7 +70,6 @@ async def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResourceCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.EurekaServerResourceCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -91,21 +90,20 @@ async def list( ) cls: ClsType[_models.EurekaServerResourceCollection] = kwargs.pop("cls", None) - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -117,13 +115,9 @@ async def list( deserialized = self._deserialize("EurekaServerResourceCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers" - } + return deserialized # type: ignore @distributed_trace_async async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.EurekaServerResource: @@ -134,7 +128,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.EurekaServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -155,21 +148,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -181,19 +173,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -221,7 +209,7 @@ async def _update_put_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -229,16 +217,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -261,10 +248,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload async def begin_update_put( self, @@ -288,14 +271,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -308,7 +283,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -321,18 +296,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -345,7 +312,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -356,20 +323,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -404,7 +360,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -417,23 +373,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return AsyncLROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -461,7 +415,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -469,16 +423,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -501,10 +454,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload async def begin_update_patch( self, @@ -528,14 +477,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -548,7 +489,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -561,18 +502,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -585,7 +518,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -596,20 +529,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -644,7 +566,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -656,14 +578,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return AsyncLROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_gateway_custom_domains_operations.py index c51995dd6a5..f3f7e8c7eba 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_gateway_route_configs_operations.py index 777067b6d6b..a0bced608b3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -264,7 +245,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -283,18 +264,10 @@ async def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -309,7 +282,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -325,20 +298,9 @@ async def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -375,7 +337,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -385,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -416,23 +376,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +401,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +418,6 @@ async def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -501,7 +448,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -510,17 +457,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -535,7 +478,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -561,18 +503,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -583,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -600,11 +541,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -615,7 +556,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_gateways_operations.py index c1ce6d19f6e..bc1106911a6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ async def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -100,22 +99,21 @@ async def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,20 +125,16 @@ async def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -177,16 +171,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -206,10 +199,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,24 +330,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_capacity_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> Optional[_models.GatewayResource]: error_map = { @@ -413,7 +373,7 @@ async def _update_capacity_initial( else: _json = self._serialize.body(gateway_capacity_resource, "SkuObject") - request = build_update_capacity_request( + _request = build_update_capacity_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -422,16 +382,15 @@ async def _update_capacity_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_capacity_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,13 +408,9 @@ async def _update_capacity_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_capacity_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore @overload async def begin_update_capacity( @@ -482,14 +437,6 @@ async def begin_update_capacity( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -503,7 +450,7 @@ async def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: IO, + gateway_capacity_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -518,18 +465,10 @@ async def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Required. - :type gateway_capacity_resource: IO + :type gateway_capacity_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -543,7 +482,7 @@ async def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Operation to update an exiting Spring Cloud Gateway capacity. @@ -556,20 +495,9 @@ async def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a - SkuObject type or a IO type. Required. + SkuObject type or a IO[bytes] type. Required. :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.SkuObject - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -605,7 +533,7 @@ async def begin_update_capacity( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -617,17 +545,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_capacity.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -648,22 +574,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -673,11 +598,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -692,14 +613,6 @@ async def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -729,7 +642,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -738,17 +651,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_env_secrets( @@ -763,7 +672,6 @@ async def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -784,22 +692,21 @@ async def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -811,13 +718,9 @@ async def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -838,22 +741,21 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -867,11 +769,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_restart( @@ -886,14 +784,6 @@ async def begin_restart( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -923,7 +813,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -934,17 +824,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -957,7 +843,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayResource] @@ -982,17 +867,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +887,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -1020,11 +904,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,10 +920,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload async def validate_domain( self, @@ -1066,7 +946,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1078,7 +957,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1093,11 +972,10 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1109,7 +987,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -1122,13 +1000,9 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1158,7 +1032,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1167,16 +1041,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1188,10 +1061,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_monitoring_settings_operations.py index ba8c1060c62..cf526ffe986 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -346,23 +308,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -390,7 +350,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -398,16 +358,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,10 +386,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -454,14 +409,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -474,7 +421,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -487,18 +434,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -511,7 +450,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -522,20 +461,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +498,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -580,14 +508,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_operations.py index 905a92d3902..c5190a05a89 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_predefined_accelerators_operations.py index 05164605b0a..4d499dc3617 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace_async async def get( self, @@ -179,7 +173,6 @@ async def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -200,23 +193,22 @@ async def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,13 +220,9 @@ async def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore async def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -260,23 +248,22 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -286,11 +273,7 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_disable( @@ -312,14 +295,6 @@ async def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -350,7 +325,7 @@ async def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -359,17 +334,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -395,23 +366,22 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +391,7 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_enable( @@ -447,14 +413,6 @@ async def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -485,7 +443,7 @@ async def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -494,14 +452,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_runtime_versions_operations.py index 94a92fa716d..a228f2d26c2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_service_registries_operations.py index bdbb9f9a2c8..e49d77ee0ff 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,13 +120,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -149,22 +143,21 @@ async def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -184,10 +177,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -201,14 +190,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -241,7 +222,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -251,17 +232,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -282,22 +261,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,11 +285,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -326,14 +300,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -363,7 +329,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -372,17 +338,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -395,7 +357,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -421,17 +382,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -442,14 +402,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -459,11 +419,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -474,7 +434,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_services_operations.py index 83507bad577..6ac8b566f13 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -85,7 +85,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -106,21 +105,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,16 +130,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -168,7 +166,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -176,16 +174,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,10 +205,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +227,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -254,7 +239,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -267,18 +252,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -288,7 +265,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -298,19 +279,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -345,7 +315,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -355,17 +325,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -386,21 +354,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -410,11 +377,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -425,14 +388,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -461,7 +416,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -470,20 +425,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -510,7 +465,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -518,16 +473,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -547,10 +501,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -573,14 +523,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -593,7 +535,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -606,18 +548,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -627,7 +561,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -636,20 +574,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -684,7 +611,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -694,17 +621,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -715,7 +640,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -736,21 +660,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -762,13 +685,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -793,7 +712,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -804,7 +722,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -817,11 +735,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -832,7 +749,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -843,13 +760,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_07_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -879,7 +792,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -887,16 +800,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -908,13 +820,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -927,7 +835,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -948,21 +855,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -972,11 +878,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -989,7 +891,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1010,21 +911,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,13 +936,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1063,35 +959,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1102,14 +993,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1138,7 +1021,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1147,17 +1030,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1178,35 +1057,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1217,14 +1091,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1253,7 +1119,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1262,17 +1128,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1293,21 +1155,20 @@ async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-retur ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_flush_vnet_dns_setting_request( + _request = build_flush_vnet_dns_setting_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._flush_vnet_dns_setting_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1321,11 +1182,7 @@ async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-retur response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _flush_vnet_dns_setting_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_flush_vnet_dns_setting( @@ -1338,14 +1195,6 @@ async def begin_flush_vnet_dns_setting( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1374,7 +1223,7 @@ async def begin_flush_vnet_dns_setting( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1385,17 +1234,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_flush_vnet_dns_setting.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_supported_apm_types( @@ -1408,7 +1253,6 @@ def list_supported_apm_types( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedApmType or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.SupportedApmType] @@ -1433,17 +1277,16 @@ def list_supported_apm_types( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_apm_types_request( + _request = build_list_supported_apm_types_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_apm_types.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1454,14 +1297,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("SupportedApmTypes", pipeline_response) @@ -1471,11 +1314,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1487,10 +1330,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_supported_apm_types.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes" - } - @distributed_trace_async async def list_globally_enabled_apms( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1502,7 +1341,6 @@ async def list_globally_enabled_apms( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GloballyEnabledApms or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.GloballyEnabledApms :raises ~azure.core.exceptions.HttpResponseError: @@ -1523,21 +1361,20 @@ async def list_globally_enabled_apms( ) cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None) - request = build_list_globally_enabled_apms_request( + _request = build_list_globally_enabled_apms_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_globally_enabled_apms.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1549,16 +1386,12 @@ async def list_globally_enabled_apms( deserialized = self._deserialize("GloballyEnabledApms", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_globally_enabled_apms.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms" - } + return deserialized # type: ignore async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1585,7 +1418,7 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s else: _json = self._serialize.body(apm, "ApmReference") - request = build_enable_apm_globally_request( + _request = build_enable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1593,16 +1426,15 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s content_type=content_type, json=_json, content=_content, - template_url=self._enable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1616,11 +1448,7 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload async def begin_enable_apm_globally( @@ -1644,14 +1472,6 @@ async def begin_enable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1662,7 +1482,7 @@ async def begin_enable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1675,18 +1495,10 @@ async def begin_enable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the enable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1694,7 +1506,7 @@ async def begin_enable_apm_globally( @distributed_trace_async async def begin_enable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Enable an APM globally. @@ -1703,20 +1515,9 @@ async def begin_enable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the enable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the enable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmReference or IO[bytes] :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: @@ -1748,7 +1549,7 @@ async def begin_enable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1760,20 +1561,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1800,7 +1597,7 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(apm, "ApmReference") - request = build_disable_apm_globally_request( + _request = build_disable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1808,16 +1605,15 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._disable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1831,11 +1627,7 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload async def begin_disable_apm_globally( @@ -1859,14 +1651,6 @@ async def begin_disable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1877,7 +1661,7 @@ async def begin_disable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1890,18 +1674,10 @@ async def begin_disable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the disable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1909,7 +1685,7 @@ async def begin_disable_apm_globally( @distributed_trace_async async def begin_disable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Disable an APM globally. @@ -1918,20 +1694,9 @@ async def begin_disable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the disable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the disable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmReference or IO[bytes] :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: @@ -1963,7 +1728,7 @@ async def begin_disable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1975,17 +1740,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -2006,7 +1767,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2014,18 +1774,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2033,20 +1797,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_07_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2076,23 +1839,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2104,19 +1866,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceResource] @@ -2141,15 +1898,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2160,14 +1916,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2177,11 +1933,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2193,8 +1949,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -2202,7 +1956,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceResource] @@ -2227,16 +1980,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2247,14 +1999,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2264,11 +2016,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2279,7 +2031,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_skus_operations.py index 9390952ae83..3c798e3b6a3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_storages_operations.py index 472ddfea1b4..7a0ab514f3f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -270,18 +251,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -295,7 +268,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -308,20 +281,9 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -357,7 +319,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -367,17 +329,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -398,22 +358,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -423,11 +382,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -442,14 +397,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -479,7 +426,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -488,17 +435,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -511,7 +454,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.StorageResource] @@ -536,17 +478,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -557,14 +498,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -574,11 +515,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,7 +530,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/models/_models_py3.py index cf098e3dad1..3c67c2e67aa 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/models/_models_py3.py @@ -30,7 +30,7 @@ class AcceleratorAuthSetting(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AcceleratorBasicAuthSetting, AcceleratorPublicSetting, AcceleratorSshSetting - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -61,7 +61,7 @@ def __init__(self, **kwargs: Any) -> None: class AcceleratorBasicAuthSetting(AcceleratorAuthSetting): """Auth setting for basic auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -106,7 +106,7 @@ def __init__( class AcceleratorGitRepository(_serialization.Model): """AcceleratorGitRepository. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: Git repository URL for the accelerator. Required. :vartype url: str @@ -175,7 +175,7 @@ def __init__( class AcceleratorPublicSetting(AcceleratorAuthSetting): """Auth setting for public url. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -205,7 +205,7 @@ def __init__(self, *, ca_cert_resource_id: Optional[str] = None, **kwargs: Any) class AcceleratorSshSetting(AcceleratorAuthSetting): """Auth setting for SSH auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -345,24 +345,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2023_07_01_preview.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class ApiPortalCustomDomainResource(ProxyResource): """Custom domain of the API portal. @@ -675,7 +657,7 @@ class ApmProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: APM Type. Required. :vartype type: str @@ -727,7 +709,7 @@ def __init__( class ApmReference(_serialization.Model): """A reference to the APM. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of the APM. Required. :vartype resource_id: str @@ -1616,7 +1598,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -1678,7 +1660,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -2567,7 +2549,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2605,7 +2587,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2990,7 +2972,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3062,7 +3044,7 @@ def __init__(self, **kwargs: Any) -> None: class CertificateReference(_serialization.Model): """A reference to the certificate. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of the certificate. Required. :vartype resource_id: str @@ -3325,7 +3307,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -3635,7 +3617,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -3672,7 +3654,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -4018,7 +4000,7 @@ def __init__( self.git_property = git_property -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -4074,7 +4056,7 @@ class ContainerRegistryCredentials(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ContainerRegistryBasicCredentials - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The credential type of the container registry credentials. Required. :vartype type: str @@ -4099,7 +4081,7 @@ def __init__(self, **kwargs: Any) -> None: class ContainerRegistryBasicCredentials(ContainerRegistryCredentials): """The basic authentication properties for the container registry resource. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The credential type of the container registry credentials. Required. :vartype type: str @@ -4146,7 +4128,7 @@ class ContainerRegistryProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar credentials: The credentials of the container registry resource. Required. :vartype credentials: @@ -4286,7 +4268,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -4420,7 +4402,7 @@ def __init__( class CustomContainerUserSourceInfo(UserSourceInfo): """Custom container user source info. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4578,7 +4560,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -4632,7 +4614,7 @@ class CustomizedAcceleratorProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar provisioning_state: State of the customized accelerator. Known values are: "Creating", "Updating", "Succeeded", "Failed", and "Deleting". @@ -4825,7 +4807,7 @@ def __init__( class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -5809,7 +5791,7 @@ class ProbeAction(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ExecAction, HTTPGetAction, TCPSocketAction - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -5837,7 +5819,7 @@ def __init__(self, **kwargs: Any) -> None: class ExecAction(ProbeAction): """ExecAction describes a "run in container" action. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -6798,7 +6780,7 @@ def __init__( class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -6920,7 +6902,7 @@ def __init__(self, *, value: Optional[List[str]] = None, **kwargs: Any) -> None: class HTTPGetAction(ProbeAction): """HTTPGetAction describes an action based on HTTP Get requests. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -7148,7 +7130,7 @@ class UploadedUserSourceInfo(UserSourceInfo): You probably want to use the sub-classes and not this class directly. Known sub-classes are: JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7191,7 +7173,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7247,7 +7229,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -7341,7 +7323,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -7375,7 +7357,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -7443,7 +7425,7 @@ class MaintenanceScheduleConfiguration(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: WeeklyMaintenanceScheduleConfiguration - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar frequency: The frequency to run the maintenance job. Required. "Weekly" :vartype frequency: str or ~azure.mgmt.appplatform.v2023_07_01_preview.models.Frequency @@ -7857,7 +7839,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -7890,7 +7872,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -8375,7 +8357,7 @@ class Probe(_serialization.Model): """Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive traffic. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar probe_action: The action of the probe. :vartype probe_action: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ProbeAction @@ -8496,7 +8478,7 @@ def __init__( class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2023_07_01_preview.models.TestKeyType @@ -9539,7 +9521,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -9613,7 +9595,7 @@ def __init__(self, *, sku: Optional["_models.Sku"] = None, **kwargs: Any) -> Non class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -9754,7 +9736,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2023_07_01_preview.models.StorageType @@ -9779,7 +9761,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2023_07_01_preview.models.StorageType @@ -10294,7 +10276,7 @@ def __init__( class TCPSocketAction(ProbeAction): """TCPSocketAction describes an action based on opening a socket. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -10477,7 +10459,7 @@ class WeeklyMaintenanceScheduleConfiguration(MaintenanceScheduleConfiguration): 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. + All required parameters must be populated in order to send to server. :ivar frequency: The frequency to run the maintenance job. Required. "Weekly" :vartype frequency: str or ~azure.mgmt.appplatform.v2023_07_01_preview.models.Frequency diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_api_portal_custom_domains_operations.py index f6c594d143c..a162ef0f441 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_api_portals_operations.py index 0f9ea622fdf..597e5cceb34 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -465,20 +438,9 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -524,17 +486,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -555,22 +515,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,11 +539,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -599,14 +554,6 @@ def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -636,7 +583,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,17 +592,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: @@ -666,7 +609,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.ApiPortalResource] @@ -691,17 +633,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -712,14 +653,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -729,11 +670,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -745,10 +686,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload def validate_domain( self, @@ -775,7 +712,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -787,7 +723,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -802,11 +738,10 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -818,7 +753,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -831,13 +766,9 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -867,7 +798,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -876,16 +807,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +827,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_apms_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_apms_operations.py index bc395951dc0..83c109988b2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_apms_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_apms_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -228,7 +228,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApmResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmResource] @@ -253,17 +252,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -274,14 +272,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApmResourceCollection", pipeline_response) @@ -291,11 +289,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,10 +305,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms" - } - @distributed_trace def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any) -> _models.ApmResource: """Get the APM by name. @@ -322,7 +316,6 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmResource :raises ~azure.core.exceptions.HttpResponseError: @@ -343,22 +336,21 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar ) cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -370,20 +362,16 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> _models.ApmResource: error_map = { @@ -411,7 +399,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(apm_resource, "ApmResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, @@ -420,16 +408,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,10 +436,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } - @overload def begin_create_or_update( self, @@ -478,14 +461,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -499,7 +474,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: IO, + apm_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -514,18 +489,10 @@ def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Required. - :type apm_resource: IO + :type apm_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -539,7 +506,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApmResource]: """Create or update an APM. @@ -552,19 +519,8 @@ def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Is either a ApmResource - type or a IO type. Required. - :type apm_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmResource or IO[bytes] :return: An instance of LROPoller that returns either ApmResource or the result of cls(response) :rtype: @@ -600,7 +556,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -610,17 +566,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApmResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return LROPoller[_models.ApmResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -641,22 +595,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -670,11 +623,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -689,14 +638,6 @@ def begin_delete( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_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: @@ -726,7 +667,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -737,17 +678,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_secret_keys( @@ -762,7 +699,6 @@ def list_secret_keys( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmSecretKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmSecretKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -783,22 +719,21 @@ def list_secret_keys( ) cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None) - request = build_list_secret_keys_request( + _request = build_list_secret_keys_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_secret_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -810,10 +745,6 @@ def list_secret_keys( deserialized = self._deserialize("ApmSecretKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_secret_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_application_accelerators_operations.py index 4b1666b2cd5..cc87f5a2903 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -204,7 +204,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -230,17 +229,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -251,14 +249,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -268,11 +266,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -284,10 +282,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -301,7 +295,6 @@ def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -322,22 +315,21 @@ def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,20 +341,16 @@ def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -390,7 +378,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -399,16 +387,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,10 +415,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -459,14 +442,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -480,7 +455,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -496,18 +471,10 @@ def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -521,7 +488,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -534,20 +501,9 @@ def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -583,7 +539,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -593,17 +549,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -624,22 +578,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -649,11 +602,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -668,14 +617,6 @@ def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -705,7 +646,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -714,14 +655,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_application_live_views_operations.py index b5eac69714f..eefd3ae20db 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -198,7 +198,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -224,17 +223,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -245,14 +243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -262,11 +260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -278,10 +276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -295,7 +289,6 @@ def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -316,22 +309,21 @@ def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,20 +335,16 @@ def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -526,20 +493,9 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -616,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_apps_operations.py index 0301080b2a5..724b6a2ce06 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -373,23 +372,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -401,20 +399,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -442,7 +436,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -451,16 +445,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -483,10 +476,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -512,14 +501,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -533,7 +514,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -548,18 +529,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -573,7 +546,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -586,19 +559,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -634,7 +596,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -644,17 +606,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -675,22 +635,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -700,11 +659,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -719,14 +674,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -756,7 +703,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -765,24 +712,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -810,7 +753,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -819,16 +762,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -848,10 +790,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -877,14 +815,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -898,7 +828,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -913,18 +843,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -938,7 +860,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -950,20 +872,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -999,7 +910,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1009,17 +920,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1030,7 +939,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.AppResource] @@ -1055,17 +963,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1076,14 +983,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1093,11 +1000,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1109,10 +1016,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1126,7 +1029,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1147,22 +1049,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,20 +1075,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1215,7 +1112,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1224,16 +1121,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1253,10 +1149,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1283,14 +1175,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1304,7 +1188,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1319,18 +1203,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1344,7 +1220,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1357,20 +1233,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1406,7 +1271,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1416,17 +1281,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1454,7 +1317,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1466,7 +1328,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1481,11 +1343,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1497,7 +1358,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1510,13 +1371,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1546,7 +1403,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1555,16 +1412,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,10 +1432,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_bindings_operations.py index cda38c8e280..d84590fa66f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -871,20 +793,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.BindingResource] @@ -981,18 +889,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +910,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1020,11 +927,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1035,7 +942,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_build_service_agent_pool_operations.py index cf2d9475bf2..2b37f0f549c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -209,18 +208,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -231,14 +229,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -248,11 +246,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -264,10 +262,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -283,7 +277,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -304,23 +297,22 @@ def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -332,13 +324,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -346,7 +334,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -374,7 +362,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -384,16 +372,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -413,10 +400,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -446,14 +429,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -468,7 +443,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -485,18 +460,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -511,7 +478,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -526,20 +493,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -576,7 +532,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +542,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_build_service_builder_operations.py index 3de5484cefd..df6619e1a74 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -261,7 +261,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -282,23 +281,22 @@ def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -310,13 +308,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -324,7 +318,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -352,7 +346,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -362,16 +356,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -391,10 +384,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -423,14 +412,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -445,7 +426,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -462,18 +443,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -488,7 +461,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -503,20 +476,9 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -553,7 +515,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -563,17 +525,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -594,23 +554,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -620,11 +579,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -641,14 +596,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -679,7 +626,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -688,17 +635,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -713,7 +656,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.BuilderResource] @@ -738,18 +680,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -760,14 +701,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -777,11 +718,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,10 +734,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -812,7 +749,6 @@ def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -833,23 +769,22 @@ def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -861,10 +796,6 @@ def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_build_service_operations.py index 420f1f1a8af..0d5c6e5d7b3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -607,7 +607,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildService] @@ -632,17 +631,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -653,14 +651,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -670,11 +668,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -686,10 +684,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -703,7 +697,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -724,22 +717,21 @@ def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,20 +743,16 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> _models.BuildService: error_map = { @@ -792,7 +780,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(build_service, "BuildService") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -801,16 +789,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -830,10 +817,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } - @overload def begin_create_or_update( self, @@ -859,14 +842,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -880,7 +855,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: IO, + build_service: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -895,18 +870,10 @@ def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Required. - :type build_service: IO + :type build_service: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -920,7 +887,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildService]: """Create a build service resource. @@ -933,19 +900,9 @@ def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Is either a BuildService type or a - IO type. Required. - :type build_service: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildService or + IO[bytes] :return: An instance of LROPoller that returns either BuildService or the result of cls(response) :rtype: @@ -981,7 +938,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -993,17 +950,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildService].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return LROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_builds( @@ -1018,7 +973,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -1042,18 +996,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1064,14 +1017,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -1081,11 +1034,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1097,10 +1050,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1116,7 +1065,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1137,23 +1085,22 @@ def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1165,13 +1112,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -1201,7 +1144,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1214,7 +1156,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1231,11 +1173,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1248,7 +1189,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -1262,13 +1203,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2023_07_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2023_07_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1298,7 +1235,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1308,16 +1245,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1337,10 +1273,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - def _delete_build_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> None: @@ -1360,23 +1292,22 @@ def _delete_build_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_build_request( + _request = build_delete_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_build_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1390,11 +1321,7 @@ def _delete_build_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_build_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete_build( @@ -1411,14 +1338,6 @@ def begin_delete_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_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: @@ -1449,7 +1368,7 @@ def begin_delete_build( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1460,17 +1379,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_build_results( @@ -1487,7 +1402,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildResult] @@ -1512,19 +1426,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1535,14 +1448,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1552,11 +1465,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1568,10 +1481,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1595,7 +1504,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1616,7 +1524,7 @@ def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1624,16 +1532,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1645,13 +1552,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1676,7 +1579,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1697,7 +1599,7 @@ def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1705,16 +1607,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1726,13 +1627,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1747,7 +1644,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1768,22 +1664,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1795,13 +1690,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1816,7 +1707,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1837,22 +1727,21 @@ def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1864,13 +1753,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1887,7 +1772,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1908,23 +1792,22 @@ def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1936,13 +1819,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1957,7 +1836,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1978,22 +1856,21 @@ def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2005,13 +1882,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -2028,7 +1901,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -2049,23 +1921,22 @@ def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2077,10 +1948,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_buildpack_binding_operations.py index cc794ade79d..1aaaaaa4527 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -262,7 +262,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -288,17 +287,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -309,14 +307,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -326,11 +324,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -342,10 +340,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace def get( self, @@ -369,7 +363,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -390,7 +383,7 @@ def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -398,16 +391,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -419,13 +411,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -434,7 +422,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -462,7 +450,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -473,16 +461,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -502,10 +489,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -539,14 +522,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -562,7 +537,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -582,18 +557,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -609,7 +576,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -626,20 +593,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -677,7 +633,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -687,17 +643,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -724,7 +678,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -732,16 +686,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,11 +704,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -780,14 +729,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -819,7 +760,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -828,17 +769,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -855,7 +792,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -881,19 +817,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -904,14 +839,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -921,11 +856,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -936,7 +871,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_certificates_operations.py index 8ac5af55b5c..f78026d81ad 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -493,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -524,22 +484,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -549,11 +508,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -568,14 +523,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -605,7 +552,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -614,17 +561,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -637,7 +580,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.CertificateResource] @@ -662,17 +604,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -683,14 +624,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -700,11 +641,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -715,7 +656,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_config_servers_operations.py index a9911a7a1e7..e57d21baa7e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -474,23 +436,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -518,7 +478,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -526,16 +486,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,10 +514,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -582,14 +537,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -602,7 +549,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -615,18 +562,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -639,7 +578,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -650,20 +589,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -698,7 +626,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -708,23 +636,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -752,7 +678,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -760,16 +686,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -789,10 +714,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -816,14 +737,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -836,7 +749,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -849,18 +762,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -873,7 +778,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -884,20 +789,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -932,7 +826,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -944,14 +838,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_configuration_services_operations.py index c2ce79e686a..ba1f2aa3c68 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -280,7 +280,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -301,22 +300,21 @@ def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -328,20 +326,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -369,7 +363,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -378,16 +372,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -407,10 +400,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -438,14 +427,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -459,7 +440,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -475,18 +456,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -500,7 +473,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -514,20 +487,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -563,7 +525,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -573,17 +535,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -604,22 +564,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -629,11 +588,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -648,14 +603,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -685,7 +632,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -694,17 +641,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -717,7 +660,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -743,17 +685,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -764,14 +705,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -781,11 +722,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -797,16 +738,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -834,7 +771,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -843,16 +780,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -872,10 +808,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -901,14 +833,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -922,7 +846,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -937,18 +861,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -962,7 +878,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -975,20 +891,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1024,7 +929,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1036,24 +941,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_resource_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> Optional[_models.ConfigurationServiceSettingsValidateResult]: error_map = { @@ -1081,7 +984,7 @@ def _validate_resource_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_validate_resource_request( + _request = build_validate_resource_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -1090,16 +993,15 @@ def _validate_resource_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_resource_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1117,13 +1019,9 @@ def _validate_resource_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - _validate_resource_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return deserialized # type: ignore @overload def begin_validate_resource( @@ -1152,14 +1050,6 @@ def begin_validate_resource( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1173,7 +1063,7 @@ def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1189,18 +1079,10 @@ def begin_validate_resource( :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be validated. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1214,7 +1096,7 @@ def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service resource is valid. @@ -1227,20 +1109,9 @@ def begin_validate_resource( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be - validated. Is either a ConfigurationServiceResource type or a IO type. Required. + validated. Is either a ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1276,7 +1147,7 @@ def begin_validate_resource( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1288,14 +1159,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_resource.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_container_registries_operations.py index 0b86b41cd08..e80fb04bc28 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_container_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_container_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -241,7 +241,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContainerRegistryResource or the result of cls(response) :rtype: @@ -267,17 +266,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -288,14 +286,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) @@ -305,11 +303,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +319,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -338,7 +332,6 @@ def get( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ContainerRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -359,22 +352,21 @@ def get( ) cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -386,20 +378,16 @@ def get( deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> _models.ContainerRegistryResource: error_map = { @@ -427,7 +415,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -436,16 +424,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -465,10 +452,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } - @overload def begin_create_or_update( self, @@ -495,14 +478,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -516,7 +491,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: IO, + container_registry_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -531,18 +506,10 @@ def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Required. - :type container_registry_resource: IO + :type container_registry_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -556,7 +523,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ContainerRegistryResource]: """Create or update container registry resource. @@ -569,20 +536,9 @@ def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Is either a - ContainerRegistryResource type or a IO type. Required. + ContainerRegistryResource type or a IO[bytes] type. Required. :type container_registry_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ContainerRegistryResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ContainerRegistryResource or IO[bytes] :return: An instance of LROPoller that returns either ContainerRegistryResource or the result of cls(response) :rtype: @@ -618,7 +574,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -630,17 +586,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ContainerRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return LROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -661,22 +615,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -690,11 +643,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -709,14 +658,6 @@ def begin_delete( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_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: @@ -746,7 +687,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -757,24 +698,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _validate_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.ContainerRegistryValidateResult]: error_map = { @@ -802,7 +739,7 @@ def _validate_initial( else: _json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -811,16 +748,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -838,13 +774,9 @@ def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return deserialized # type: ignore @overload def begin_validate( @@ -872,14 +804,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -893,7 +817,7 @@ def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: IO, + container_registry_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -908,18 +832,10 @@ def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Required. - :type container_registry_properties: IO + :type container_registry_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -933,7 +849,7 @@ def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ContainerRegistryValidateResult]: """Check if the container registry properties are valid. @@ -946,20 +862,9 @@ def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Is either a - ContainerRegistryProperties type or a IO type. Required. + ContainerRegistryProperties type or a IO[bytes] type. Required. :type container_registry_properties: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.ContainerRegistryProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.ContainerRegistryProperties or IO[bytes] :return: An instance of LROPoller that returns either ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -995,7 +900,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1007,14 +912,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ContainerRegistryValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return LROPoller[_models.ContainerRegistryValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_custom_domains_operations.py index 0d87c2d4828..a3df8fe4e18 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -871,20 +793,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -982,18 +890,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1004,14 +911,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1021,11 +928,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,7 +943,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_customized_accelerators_operations.py index f1993397cf2..2f13d5bc959 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -272,7 +272,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -298,18 +297,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -320,14 +318,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -337,11 +335,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +351,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace def get( self, @@ -377,7 +371,6 @@ def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -398,23 +391,22 @@ def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,13 +418,9 @@ def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -440,7 +428,7 @@ def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -468,7 +456,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -478,16 +466,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -507,10 +494,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -541,14 +524,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -563,7 +538,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +556,10 @@ def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -607,7 +574,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -622,20 +589,9 @@ def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -672,7 +628,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -682,17 +638,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -718,23 +672,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -744,11 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -770,14 +719,6 @@ def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -808,7 +749,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -817,17 +758,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def validate( @@ -858,7 +795,6 @@ def validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -872,7 +808,7 @@ def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -889,11 +825,10 @@ def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -907,7 +842,7 @@ def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -922,13 +857,9 @@ def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -959,7 +890,7 @@ def validate( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -969,16 +900,15 @@ def validate( content_type=content_type, json=_json, content=_content, - template_url=self.validate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -992,10 +922,6 @@ def validate( deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_deployments_operations.py index c879120107c..34dedc200e2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -468,7 +468,7 @@ def build_disable_remote_debugging_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_remote_debugging_config_request( +def build_get_remote_debugging_config_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, app_name: str, @@ -702,7 +702,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -723,23 +722,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,13 +749,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -765,7 +759,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -793,7 +787,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -803,16 +797,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -835,10 +828,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -868,14 +857,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -890,7 +871,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -907,18 +888,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -933,7 +906,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -948,20 +921,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -998,7 +960,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1008,17 +970,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1039,23 +999,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1065,11 +1024,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -1086,14 +1041,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1124,7 +1071,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1133,17 +1080,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1151,7 +1094,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1179,7 +1122,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1189,16 +1132,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1218,10 +1160,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1251,14 +1189,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1273,7 +1203,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1290,18 +1220,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1316,7 +1238,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1331,20 +1253,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1381,7 +1292,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1391,17 +1302,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1423,7 +1332,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentResource] @@ -1448,19 +1356,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1471,14 +1378,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1488,11 +1395,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1504,10 +1411,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, resource_group_name: str, service_name: str, version: Optional[List[str]] = None, **kwargs: Any @@ -1521,7 +1424,6 @@ def list_for_cluster( :type service_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.DeploymentResource] @@ -1546,18 +1448,17 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1568,14 +1469,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1585,11 +1486,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1601,10 +1502,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1624,23 +1521,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1650,11 +1546,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1671,14 +1563,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1709,7 +1593,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1718,17 +1602,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1749,23 +1629,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1775,11 +1654,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1796,14 +1671,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1834,7 +1701,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1843,17 +1710,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1874,23 +1737,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1900,11 +1762,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1921,14 +1779,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1959,7 +1809,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1968,17 +1818,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_remote_debugging_initial( self, @@ -1986,7 +1832,7 @@ def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -2017,7 +1863,7 @@ def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2027,16 +1873,15 @@ def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2056,10 +1901,6 @@ def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload def begin_enable_remote_debugging( self, @@ -2089,14 +1930,6 @@ def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2111,7 +1944,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2128,18 +1961,10 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2154,7 +1979,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> LROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -2169,20 +1994,9 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of LROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -2219,7 +2033,7 @@ def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2229,17 +2043,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2260,23 +2072,22 @@ def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2296,10 +2107,6 @@ def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2315,14 +2122,6 @@ def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -2356,7 +2155,7 @@ def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2366,17 +2165,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def get_remote_debugging_config( @@ -2393,7 +2190,6 @@ def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -2414,23 +2210,22 @@ def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2442,13 +2237,9 @@ def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace def get_log_file_url( @@ -2465,7 +2256,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -2486,23 +2276,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2516,13 +2305,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2530,7 +2315,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2558,7 +2343,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2568,16 +2353,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2587,11 +2371,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2622,14 +2402,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2642,7 +2414,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2659,18 +2431,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2683,7 +2447,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2698,20 +2462,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2745,7 +2498,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2754,17 +2507,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2772,7 +2521,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2800,7 +2549,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2810,16 +2559,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2829,11 +2577,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2864,14 +2608,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2884,7 +2620,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2901,18 +2637,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2925,7 +2653,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2940,20 +2668,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2987,7 +2704,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2996,17 +2713,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -3014,7 +2727,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -3042,7 +2755,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -3052,16 +2765,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -3071,11 +2783,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -3106,14 +2814,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -3126,7 +2826,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -3143,18 +2843,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -3167,7 +2859,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -3182,20 +2874,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -3229,7 +2910,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3238,14 +2919,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_dev_tool_portals_operations.py index 79501685ca0..d141f743106 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -198,7 +198,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -224,17 +223,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -245,14 +243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -262,11 +260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -278,10 +276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -295,7 +289,6 @@ def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -316,22 +309,21 @@ def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,20 +335,16 @@ def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -526,20 +493,9 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of LROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -616,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_eureka_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_eureka_servers_operations.py index cfb5a5eabef..0928f169d75 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_eureka_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_eureka_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -194,7 +194,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResourceCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.EurekaServerResourceCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -215,21 +214,20 @@ def list( ) cls: ClsType[_models.EurekaServerResourceCollection] = kwargs.pop("cls", None) - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -241,13 +239,9 @@ def list( deserialized = self._deserialize("EurekaServerResourceCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers" - } + return deserialized # type: ignore @distributed_trace def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.EurekaServerResource: @@ -258,7 +252,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.EurekaServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -279,21 +272,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -305,19 +297,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -345,7 +333,7 @@ def _update_put_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -353,16 +341,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -385,10 +372,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload def begin_update_put( self, @@ -412,14 +395,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -432,7 +407,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -445,18 +420,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -469,7 +436,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -480,20 +447,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of LROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -528,7 +484,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -540,23 +496,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return LROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -584,7 +538,7 @@ def _update_patch_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -592,16 +546,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -624,10 +577,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload def begin_update_patch( self, @@ -651,14 +600,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -671,7 +612,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -684,18 +625,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -708,7 +641,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -719,20 +652,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of LROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -767,7 +689,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -779,14 +701,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return LROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_gateway_custom_domains_operations.py index 41da03b564e..84f4bb80a72 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_gateway_route_configs_operations.py index 201fb6e1895..f91c5bd6a2b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload def begin_create_or_update( self, @@ -388,14 +377,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -410,7 +391,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -429,18 +410,10 @@ def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -471,20 +444,9 @@ def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -521,7 +483,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -531,17 +493,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -562,23 +522,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,11 +547,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -609,14 +564,6 @@ def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -647,7 +594,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -656,17 +603,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -681,7 +624,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -707,18 +649,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -729,14 +670,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -746,11 +687,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -761,7 +702,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_gateways_operations.py index d636c488066..3b5a82448f0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -334,7 +334,6 @@ def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -355,22 +354,21 @@ def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -382,20 +380,16 @@ def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -423,7 +417,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -432,16 +426,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -461,10 +454,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload def begin_create_or_update( self, @@ -490,14 +479,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -511,7 +492,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -526,18 +507,10 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -551,7 +524,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -564,20 +537,9 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -613,7 +575,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -623,24 +585,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_capacity_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> Optional[_models.GatewayResource]: error_map = { @@ -668,7 +628,7 @@ def _update_capacity_initial( else: _json = self._serialize.body(gateway_capacity_resource, "SkuObject") - request = build_update_capacity_request( + _request = build_update_capacity_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -677,16 +637,15 @@ def _update_capacity_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_capacity_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -704,13 +663,9 @@ def _update_capacity_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_capacity_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore @overload def begin_update_capacity( @@ -737,14 +692,6 @@ def begin_update_capacity( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -758,7 +705,7 @@ def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: IO, + gateway_capacity_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -773,18 +720,10 @@ def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Required. - :type gateway_capacity_resource: IO + :type gateway_capacity_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -798,7 +737,7 @@ def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Operation to update an exiting Spring Cloud Gateway capacity. @@ -811,20 +750,9 @@ def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a - SkuObject type or a IO type. Required. + SkuObject type or a IO[bytes] type. Required. :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.SkuObject - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -860,7 +788,7 @@ def begin_update_capacity( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -872,17 +800,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_capacity.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -903,22 +829,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -928,11 +853,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -947,14 +868,6 @@ def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -984,7 +897,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -993,17 +906,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_env_secrets( @@ -1018,7 +927,6 @@ def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -1039,22 +947,21 @@ def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1066,13 +973,9 @@ def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -1093,22 +996,21 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1122,11 +1024,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_restart( @@ -1141,14 +1039,6 @@ def begin_restart( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -1178,7 +1068,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1189,17 +1079,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: @@ -1210,7 +1096,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.GatewayResource] @@ -1235,17 +1120,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1256,14 +1140,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -1273,11 +1157,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1289,10 +1173,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload def validate_domain( self, @@ -1319,7 +1199,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1331,7 +1210,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1346,11 +1225,10 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1362,7 +1240,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -1375,13 +1253,9 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1411,7 +1285,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1420,16 +1294,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1441,10 +1314,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_monitoring_settings_operations.py index 08c65af19a3..135dce5d92a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -440,23 +402,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -484,7 +444,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -492,16 +452,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -521,10 +480,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -548,14 +503,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -568,7 +515,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +528,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -605,7 +544,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -616,20 +555,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_07_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -664,7 +592,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -674,14 +602,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_operations.py index 31acc3cacc8..f7e35602f8b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_predefined_accelerators_operations.py index cd55a1ace07..2d8ed742c4a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -225,7 +225,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -251,18 +250,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -273,14 +271,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -290,11 +288,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +304,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace def get( self, @@ -330,7 +324,6 @@ def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -351,23 +344,22 @@ def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -379,13 +371,9 @@ def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -411,23 +399,22 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +424,7 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_disable( @@ -463,14 +446,6 @@ def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -501,7 +476,7 @@ def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -510,17 +485,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -546,23 +517,22 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -572,11 +542,7 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_enable( @@ -598,14 +564,6 @@ def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -636,7 +594,7 @@ def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,14 +603,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_runtime_versions_operations.py index a4e261dd616..3494bd3432d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_service_registries_operations.py index e75840fb69b..e0dd7b9773a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -217,22 +216,21 @@ def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,13 +242,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -271,22 +265,21 @@ def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +299,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -323,14 +312,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -373,17 +354,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -404,22 +383,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,11 +407,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -448,14 +422,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -485,7 +451,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -494,17 +460,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -517,7 +479,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -543,17 +504,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -581,11 +541,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +556,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_services_operations.py index 5bce526a33b..4393556a5d9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -627,7 +627,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -648,21 +647,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -674,16 +672,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -710,7 +708,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -718,16 +716,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -750,10 +747,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -776,14 +769,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -796,7 +781,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -809,18 +794,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -830,7 +807,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -840,19 +821,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -887,7 +857,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -897,17 +867,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -928,21 +896,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -952,11 +919,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -967,14 +930,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1003,7 +958,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1012,20 +967,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -1052,7 +1007,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1060,16 +1015,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1089,10 +1043,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -1115,14 +1065,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1135,7 +1077,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1148,18 +1090,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1169,7 +1103,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1178,20 +1116,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1226,7 +1153,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1236,17 +1163,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1257,7 +1182,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1278,21 +1202,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1304,13 +1227,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1335,7 +1254,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1346,7 +1264,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1359,11 +1277,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1374,7 +1291,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1385,13 +1302,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_07_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1421,7 +1334,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1429,16 +1342,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1450,13 +1362,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1469,7 +1377,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1490,21 +1397,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1514,11 +1420,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1529,7 +1431,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1550,21 +1451,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,13 +1476,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1603,35 +1499,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1642,14 +1533,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1678,7 +1561,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1687,17 +1570,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1718,35 +1597,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1757,14 +1631,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1793,7 +1659,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1802,17 +1668,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1833,21 +1695,20 @@ def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-stat ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_flush_vnet_dns_setting_request( + _request = build_flush_vnet_dns_setting_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._flush_vnet_dns_setting_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1861,11 +1722,7 @@ def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-stat response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _flush_vnet_dns_setting_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_flush_vnet_dns_setting( @@ -1878,14 +1735,6 @@ def begin_flush_vnet_dns_setting( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1914,7 +1763,7 @@ def begin_flush_vnet_dns_setting( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1925,17 +1774,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_flush_vnet_dns_setting.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_supported_apm_types( @@ -1948,7 +1793,6 @@ def list_supported_apm_types( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedApmType or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.SupportedApmType] @@ -1973,17 +1817,16 @@ def list_supported_apm_types( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_apm_types_request( + _request = build_list_supported_apm_types_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_apm_types.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1994,14 +1837,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("SupportedApmTypes", pipeline_response) @@ -2011,11 +1854,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2027,10 +1870,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_supported_apm_types.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes" - } - @distributed_trace def list_globally_enabled_apms( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -2042,7 +1881,6 @@ def list_globally_enabled_apms( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GloballyEnabledApms or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.GloballyEnabledApms :raises ~azure.core.exceptions.HttpResponseError: @@ -2063,21 +1901,20 @@ def list_globally_enabled_apms( ) cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None) - request = build_list_globally_enabled_apms_request( + _request = build_list_globally_enabled_apms_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_globally_enabled_apms.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2089,16 +1926,12 @@ def list_globally_enabled_apms( deserialized = self._deserialize("GloballyEnabledApms", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_globally_enabled_apms.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms" - } + return deserialized # type: ignore def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -2125,7 +1958,7 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme else: _json = self._serialize.body(apm, "ApmReference") - request = build_enable_apm_globally_request( + _request = build_enable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -2133,16 +1966,15 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme content_type=content_type, json=_json, content=_content, - template_url=self._enable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2156,11 +1988,7 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload def begin_enable_apm_globally( @@ -2184,14 +2012,6 @@ def begin_enable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2202,7 +2022,7 @@ def begin_enable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2215,18 +2035,10 @@ def begin_enable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the enable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2234,7 +2046,7 @@ def begin_enable_apm_globally( @distributed_trace def begin_enable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Enable an APM globally. @@ -2243,20 +2055,9 @@ def begin_enable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the enable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the enable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmReference or IO[bytes] :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: @@ -2288,7 +2089,7 @@ def begin_enable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2299,20 +2100,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -2339,7 +2136,7 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(apm, "ApmReference") - request = build_disable_apm_globally_request( + _request = build_disable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -2347,16 +2144,15 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._disable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2370,11 +2166,7 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload def begin_disable_apm_globally( @@ -2398,14 +2190,6 @@ def begin_disable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2416,7 +2200,7 @@ def begin_disable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2429,18 +2213,10 @@ def begin_disable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the disable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2448,7 +2224,7 @@ def begin_disable_apm_globally( @distributed_trace def begin_disable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Disable an APM globally. @@ -2457,20 +2233,9 @@ def begin_disable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the disable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the disable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_07_01_preview.models.ApmReference or IO[bytes] :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: @@ -2502,7 +2267,7 @@ def begin_disable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2513,17 +2278,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -2544,7 +2305,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2552,18 +2312,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2571,20 +2335,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2023_07_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_07_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2614,23 +2377,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2642,19 +2404,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceResource] @@ -2679,15 +2436,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2698,14 +2454,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2715,11 +2471,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2731,8 +2487,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -2740,7 +2494,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.ServiceResource] @@ -2765,16 +2518,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2785,14 +2537,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2802,11 +2554,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2817,7 +2569,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_skus_operations.py index 087624da950..917774fa6d9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_storages_operations.py index 5861958bfb4..9b165e933c6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_07_01_preview/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_07_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -359,14 +348,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -380,7 +361,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -395,18 +376,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -420,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -433,20 +406,9 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2023_07_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -482,7 +444,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -492,17 +454,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -523,22 +483,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +507,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -567,14 +522,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -604,7 +551,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -613,17 +560,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -634,7 +577,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_07_01_preview.models.StorageResource] @@ -659,17 +601,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -680,14 +621,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -697,11 +638,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -712,7 +653,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/_app_platform_management_client.py index 2ecbd1bb1bf..af339200eec 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -166,7 +168,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -260,7 +280,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2023-09-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -280,7 +300,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/_configuration.py index e4834347c14..c2f4658724b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-09-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/_app_platform_management_client.py index 0a5e1d700d1..351ed5fd017 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -166,7 +168,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -260,7 +280,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2023-09-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -280,7 +302,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/_configuration.py index 97b09446acf..fee781e990d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-09-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_api_portal_custom_domains_operations.py index 8c4ea56fe9b..aad1d3b595d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_api_portals_operations.py index 4ae1c614be3..7c1a6a2e950 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -365,17 +327,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -396,22 +356,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -440,14 +395,6 @@ async def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -477,7 +424,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -486,17 +433,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -509,7 +452,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.ApiPortalResource] @@ -534,17 +476,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -555,14 +496,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -572,11 +513,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +529,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload async def validate_domain( self, @@ -618,7 +555,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -630,7 +566,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -645,11 +581,10 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -661,7 +596,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -674,13 +609,9 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -710,7 +641,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -719,16 +650,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,10 +670,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_apms_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_apms_operations.py index cdf4eef5c10..1088522054b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_apms_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_apms_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -72,7 +72,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApmResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmResource] @@ -97,17 +96,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -118,14 +116,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApmResourceCollection", pipeline_response) @@ -135,11 +133,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -151,10 +149,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -168,7 +162,6 @@ async def get( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmResource :raises ~azure.core.exceptions.HttpResponseError: @@ -189,22 +182,21 @@ async def get( ) cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -216,20 +208,16 @@ async def get( deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> _models.ApmResource: error_map = { @@ -257,7 +245,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(apm_resource, "ApmResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, @@ -266,16 +254,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -295,10 +282,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } - @overload async def begin_create_or_update( self, @@ -324,14 +307,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -345,7 +320,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: IO, + apm_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -360,18 +335,10 @@ async def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Required. - :type apm_resource: IO + :type apm_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -385,7 +352,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApmResource]: """Create or update an APM. @@ -398,19 +365,8 @@ async def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Is either a ApmResource - type or a IO type. Required. - :type apm_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApmResource or the result of cls(response) :rtype: @@ -446,7 +402,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -456,17 +412,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApmResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return AsyncLROPoller[_models.ApmResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -487,22 +441,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -583,17 +524,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_secret_keys( @@ -608,7 +545,6 @@ async def list_secret_keys( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmSecretKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmSecretKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -629,22 +565,21 @@ async def list_secret_keys( ) cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None) - request = build_list_secret_keys_request( + _request = build_list_secret_keys_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_secret_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -656,10 +591,6 @@ async def list_secret_keys( deserialized = self._deserialize("ApmSecretKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_secret_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_application_accelerators_operations.py index 27e8848304d..4111e97d756 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -328,14 +311,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -349,7 +324,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -365,18 +340,10 @@ async def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -390,7 +357,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -403,20 +370,9 @@ async def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -452,7 +408,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -462,17 +418,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -493,22 +447,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -518,11 +471,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -537,14 +486,6 @@ async def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -574,7 +515,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -583,14 +524,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_application_live_views_operations.py index df97f767dbc..dd80d17d4e5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -581,14 +522,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_apps_operations.py index c7a6d214284..0ddb0186baf 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,20 +133,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -176,7 +170,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -185,16 +179,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -217,10 +210,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -246,14 +235,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -267,7 +248,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -320,19 +293,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -368,7 +330,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -378,17 +340,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -409,22 +369,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,11 +393,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -453,14 +408,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -490,7 +437,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -499,24 +446,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -544,7 +487,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -553,16 +496,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,10 +524,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -611,14 +549,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -632,7 +562,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -647,18 +577,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -672,7 +594,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -684,20 +606,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -733,7 +644,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -743,17 +654,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -764,7 +673,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.AppResource] @@ -789,17 +697,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -810,14 +717,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -827,11 +734,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -843,10 +750,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -860,7 +763,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -881,22 +783,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -908,20 +809,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -949,7 +846,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -958,16 +855,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -987,10 +883,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -1017,14 +909,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1038,7 +922,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1053,18 +937,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1078,7 +954,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1091,20 +967,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1140,7 +1005,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1150,17 +1015,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1188,7 +1051,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1200,7 +1062,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1215,11 +1077,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1231,7 +1092,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1244,13 +1105,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1280,7 +1137,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1289,16 +1146,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1310,10 +1166,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_bindings_operations.py index f6031e4fdb4..8cb90d25dd1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -705,20 +627,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.BindingResource] @@ -815,18 +723,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -837,14 +744,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -854,11 +761,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -869,7 +776,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_build_service_agent_pool_operations.py index 6e1fc6aad76..16735897c26 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -174,7 +168,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -195,23 +188,22 @@ async def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -223,13 +215,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -237,7 +225,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -265,7 +253,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -275,16 +263,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -304,10 +291,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -337,14 +320,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -359,7 +334,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +351,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -402,7 +369,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -417,20 +384,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -467,7 +423,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -477,14 +433,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_build_service_builder_operations.py index 0698ca12345..8ab868ae3a9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,10 +201,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -240,14 +229,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -262,7 +243,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -279,18 +260,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -305,7 +278,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -320,20 +293,9 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -370,7 +332,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -380,17 +342,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -411,23 +371,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +396,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -458,14 +413,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -496,7 +443,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -505,17 +452,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -530,7 +473,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.BuilderResource] @@ -555,18 +497,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -577,14 +518,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -594,11 +535,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -610,10 +551,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace_async async def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -629,7 +566,6 @@ async def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -650,23 +586,22 @@ async def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -678,10 +613,6 @@ async def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_build_service_operations.py index 5e685534ae0..849887ca0f6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildService] @@ -109,17 +108,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -130,14 +128,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -147,11 +145,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -163,10 +161,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -180,7 +174,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -201,22 +194,21 @@ async def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,20 +220,16 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> _models.BuildService: error_map = { @@ -269,7 +257,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(build_service, "BuildService") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -278,16 +266,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,10 +294,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } - @overload async def begin_create_or_update( self, @@ -336,14 +319,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -357,7 +332,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: IO, + build_service: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -372,18 +347,10 @@ async def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Required. - :type build_service: IO + :type build_service: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -397,7 +364,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildService]: """Create a build service resource. @@ -410,19 +377,9 @@ async def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Is either a BuildService type or a - IO type. Required. - :type build_service: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildService or + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildService or the result of cls(response) :rtype: @@ -458,7 +415,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -470,17 +427,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildService].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return AsyncLROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_builds( @@ -495,7 +450,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.Build] @@ -520,18 +474,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -542,14 +495,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -559,11 +512,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -575,10 +528,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -594,7 +543,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -615,23 +563,22 @@ async def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -643,13 +590,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -679,7 +622,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -692,7 +634,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -709,11 +651,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -726,7 +667,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -740,13 +681,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2023_09_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2023_09_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -776,7 +713,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -786,16 +723,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -815,10 +751,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - async def _delete_build_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> None: @@ -838,23 +770,22 @@ async def _delete_build_initial( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_build_request( + _request = build_delete_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_build_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -868,11 +799,7 @@ async def _delete_build_initial( # pylint: disable=inconsistent-return-statemen response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_build_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete_build( @@ -889,14 +816,6 @@ async def begin_delete_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_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: @@ -927,7 +846,7 @@ async def begin_delete_build( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -938,17 +857,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_build_results( @@ -965,7 +880,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildResult] @@ -990,19 +904,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1013,14 +926,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1030,11 +943,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1046,10 +959,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -1073,7 +982,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1094,7 +1002,7 @@ async def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1102,16 +1010,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1123,13 +1030,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -1154,7 +1057,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1175,7 +1077,7 @@ async def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1183,16 +1085,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1204,13 +1105,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -1225,7 +1122,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1246,22 +1142,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1273,13 +1168,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -1294,7 +1185,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1315,22 +1205,21 @@ async def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1342,13 +1231,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -1365,7 +1250,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1386,23 +1270,22 @@ async def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1414,13 +1297,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1435,7 +1314,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1456,22 +1334,21 @@ async def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1483,13 +1360,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1506,7 +1379,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1527,23 +1399,22 @@ async def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1555,10 +1426,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_buildpack_binding_operations.py index e884a35bc41..e6646ce5c96 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -100,17 +99,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -121,14 +119,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -138,11 +136,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,10 +152,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,7 +195,7 @@ async def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -210,16 +203,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -231,13 +223,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -246,7 +234,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -274,7 +262,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -285,16 +273,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -314,10 +301,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -351,14 +334,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -374,7 +349,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -394,18 +369,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -421,7 +388,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -438,20 +405,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -489,7 +445,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -499,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -536,7 +490,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -544,16 +498,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -563,11 +516,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -592,14 +541,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -631,7 +572,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -640,17 +581,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -667,7 +604,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -693,19 +629,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -716,14 +651,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -733,11 +668,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -748,7 +683,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_certificates_operations.py index 2d04380e9f1..270c6dc937c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,17 +330,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -399,22 +359,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,11 +383,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -443,14 +398,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -489,17 +436,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -512,7 +455,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.CertificateResource] @@ -537,17 +479,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -558,14 +499,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -575,11 +516,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -590,7 +531,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_config_servers_operations.py index af6fca0104e..e848b21fe65 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -345,23 +307,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -389,7 +349,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -397,16 +357,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,10 +385,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -453,14 +408,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -473,7 +420,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -486,18 +433,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -510,7 +449,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -521,20 +460,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -569,7 +497,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -579,23 +507,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -623,7 +549,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -631,16 +557,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -660,10 +585,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -687,14 +608,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -707,7 +620,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -720,18 +633,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -744,7 +649,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -755,20 +660,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -803,7 +697,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -815,14 +709,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_configuration_services_operations.py index 1fc7270f03d..903ed9a5e8a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,22 +97,21 @@ async def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,20 +123,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -166,7 +160,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -204,10 +197,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -272,18 +253,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -297,7 +270,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -311,20 +284,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -360,7 +322,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -370,17 +332,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -401,22 +361,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,11 +385,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -445,14 +400,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -482,7 +429,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -491,17 +438,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -514,7 +457,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -540,17 +482,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -561,14 +502,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -578,11 +519,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -594,16 +535,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -631,7 +568,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -640,16 +577,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -669,10 +605,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -698,14 +630,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -719,7 +643,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -734,18 +658,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -759,7 +675,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -772,20 +688,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -821,7 +726,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -833,24 +738,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_resource_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> Optional[_models.ConfigurationServiceSettingsValidateResult]: error_map = { @@ -878,7 +781,7 @@ async def _validate_resource_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_validate_resource_request( + _request = build_validate_resource_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -887,16 +790,15 @@ async def _validate_resource_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_resource_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -914,13 +816,9 @@ async def _validate_resource_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _validate_resource_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return deserialized # type: ignore @overload async def begin_validate_resource( @@ -949,14 +847,6 @@ async def begin_validate_resource( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -970,7 +860,7 @@ async def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -986,18 +876,10 @@ async def begin_validate_resource( :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be validated. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1011,7 +893,7 @@ async def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service resource is valid. @@ -1024,20 +906,9 @@ async def begin_validate_resource( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be - validated. Is either a ConfigurationServiceResource type or a IO type. Required. + validated. Is either a ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1073,7 +944,7 @@ async def begin_validate_resource( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1085,14 +956,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_resource.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_container_registries_operations.py index 8c4e5390d27..7c8dc1d96fe 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_container_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_container_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContainerRegistryResource or the result of cls(response) :rtype: @@ -100,17 +99,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -121,14 +119,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) @@ -138,11 +136,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,10 +152,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -171,7 +165,6 @@ async def get( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ContainerRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -192,22 +185,21 @@ async def get( ) cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -219,20 +211,16 @@ async def get( deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> _models.ContainerRegistryResource: error_map = { @@ -260,7 +248,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -269,16 +257,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -298,10 +285,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } - @overload async def begin_create_or_update( self, @@ -328,14 +311,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -349,7 +324,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: IO, + container_registry_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -364,18 +339,10 @@ async def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Required. - :type container_registry_resource: IO + :type container_registry_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -389,7 +356,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ContainerRegistryResource]: """Create or update container registry resource. @@ -402,20 +369,9 @@ async def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Is either a - ContainerRegistryResource type or a IO type. Required. + ContainerRegistryResource type or a IO[bytes] type. Required. :type container_registry_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ContainerRegistryResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ContainerRegistryResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the result of cls(response) :rtype: @@ -451,7 +407,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -463,17 +419,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ContainerRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return AsyncLROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -494,22 +448,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -523,11 +476,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -542,14 +491,6 @@ async def begin_delete( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_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: @@ -579,7 +520,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -590,24 +531,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _validate_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.ContainerRegistryValidateResult]: error_map = { @@ -635,7 +572,7 @@ async def _validate_initial( else: _json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -644,16 +581,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -671,13 +607,9 @@ async def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return deserialized # type: ignore @overload async def begin_validate( @@ -705,14 +637,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -726,7 +650,7 @@ async def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: IO, + container_registry_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -741,18 +665,10 @@ async def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Required. - :type container_registry_properties: IO + :type container_registry_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -766,7 +682,7 @@ async def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]: """Check if the container registry properties are valid. @@ -779,20 +695,9 @@ async def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Is either a - ContainerRegistryProperties type or a IO type. Required. + ContainerRegistryProperties type or a IO[bytes] type. Required. :type container_registry_properties: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ContainerRegistryProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ContainerRegistryProperties or IO[bytes] :return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -828,7 +733,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -840,14 +745,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ContainerRegistryValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return AsyncLROPoller[_models.ContainerRegistryValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_custom_domains_operations.py index abacbb97d57..f62c85ef042 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -705,20 +627,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -816,18 +724,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -838,14 +745,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -855,11 +762,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -870,7 +777,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_customized_accelerators_operations.py index ffd68ce85d0..942186570ff 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -102,18 +101,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -124,14 +122,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -141,11 +139,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,10 +155,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,23 +195,22 @@ async def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -230,13 +222,9 @@ async def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -244,7 +232,7 @@ async def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -272,7 +260,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -282,16 +270,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -311,10 +298,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -345,14 +328,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -367,7 +342,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -385,18 +360,10 @@ async def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -411,7 +378,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -426,20 +393,9 @@ async def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -476,7 +432,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -486,17 +442,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -522,23 +476,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +501,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -574,14 +523,6 @@ async def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -612,7 +553,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -621,17 +562,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def validate( @@ -662,7 +599,6 @@ async def validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -676,7 +612,7 @@ async def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -693,11 +629,10 @@ async def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -711,7 +646,7 @@ async def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -726,13 +661,9 @@ async def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -763,7 +694,7 @@ async def validate( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -773,16 +704,15 @@ async def validate( content_type=content_type, json=_json, content=_content, - template_url=self.validate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -796,10 +726,6 @@ async def validate( deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_deployments_operations.py index 9aad10a5e7d..cba04d28b3d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -89,7 +89,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -110,23 +109,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -138,13 +136,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -152,7 +146,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -180,7 +174,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -190,16 +184,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -222,10 +215,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -255,14 +244,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -277,7 +258,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -294,18 +275,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -320,7 +293,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -335,20 +308,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -385,7 +347,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -395,17 +357,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -426,23 +386,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -452,11 +411,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -473,14 +428,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -511,7 +458,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -520,17 +467,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -538,7 +481,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -566,7 +509,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -576,16 +519,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -605,10 +547,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -638,14 +576,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -660,7 +590,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -677,18 +607,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -703,7 +625,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -718,20 +640,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -768,7 +679,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -778,17 +689,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -813,7 +722,6 @@ def list( :type version: list[str] :param expand: The expand expression to apply on the operation. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentResource] @@ -838,7 +746,7 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -846,12 +754,11 @@ def prepare_request(next_link=None): version=version, expand=expand, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -862,14 +769,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -879,11 +786,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -895,10 +802,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, @@ -919,7 +822,6 @@ def list_for_cluster( :type version: list[str] :param expand: The expand expression to apply on the operation. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentResource] @@ -944,19 +846,18 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, expand=expand, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -967,14 +868,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -984,11 +885,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1000,10 +901,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1023,23 +920,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1049,11 +945,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1070,14 +962,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1108,7 +992,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1117,17 +1001,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1148,23 +1028,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,11 +1053,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1195,14 +1070,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1233,7 +1100,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1242,17 +1109,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1273,23 +1136,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1299,11 +1161,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1320,14 +1178,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1358,7 +1208,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1367,17 +1217,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_remote_debugging_initial( self, @@ -1385,7 +1231,7 @@ async def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -1416,7 +1262,7 @@ async def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1426,16 +1272,15 @@ async def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1455,10 +1300,6 @@ async def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload async def begin_enable_remote_debugging( self, @@ -1488,14 +1329,6 @@ async def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1510,7 +1343,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1527,18 +1360,10 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1553,7 +1378,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> AsyncLROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -1568,20 +1393,9 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -1618,7 +1432,7 @@ async def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1628,17 +1442,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1659,23 +1471,22 @@ async def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1695,10 +1506,6 @@ async def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace_async async def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1714,14 +1521,6 @@ async def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -1755,7 +1554,7 @@ async def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1765,17 +1564,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def get_remote_debugging_config( @@ -1792,7 +1589,6 @@ async def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -1813,23 +1609,22 @@ async def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1841,13 +1636,9 @@ async def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1864,7 +1655,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1885,23 +1675,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1915,13 +1704,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1929,7 +1714,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1957,7 +1742,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1967,16 +1752,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1986,11 +1770,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -2021,14 +1801,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2041,7 +1813,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2058,18 +1830,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2082,7 +1846,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -2097,20 +1861,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2144,7 +1897,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2153,17 +1906,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2171,7 +1920,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2199,7 +1948,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2209,16 +1958,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2228,11 +1976,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -2263,14 +2007,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2283,7 +2019,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2300,18 +2036,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2324,7 +2052,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -2339,20 +2067,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2386,7 +2103,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2395,17 +2112,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2413,7 +2126,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2441,7 +2154,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2451,16 +2164,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2470,11 +2182,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2505,14 +2213,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2525,7 +2225,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2542,18 +2242,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2566,7 +2258,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2581,20 +2273,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2628,7 +2309,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2637,14 +2318,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_dev_tool_portals_operations.py index fb75a32d4f3..43e4d2f3cbb 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -581,14 +522,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_eureka_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_eureka_servers_operations.py index 0e50ef51d70..97d939c3ad0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_eureka_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_eureka_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -70,7 +70,6 @@ async def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResourceCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.EurekaServerResourceCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -91,21 +90,20 @@ async def list( ) cls: ClsType[_models.EurekaServerResourceCollection] = kwargs.pop("cls", None) - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -117,13 +115,9 @@ async def list( deserialized = self._deserialize("EurekaServerResourceCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers" - } + return deserialized # type: ignore @distributed_trace_async async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.EurekaServerResource: @@ -134,7 +128,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.EurekaServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -155,21 +148,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -181,19 +173,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -221,7 +209,7 @@ async def _update_put_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -229,16 +217,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -261,10 +248,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload async def begin_update_put( self, @@ -288,14 +271,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -308,7 +283,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -321,18 +296,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -345,7 +312,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -356,20 +323,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -404,7 +360,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -417,23 +373,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return AsyncLROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -461,7 +415,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -469,16 +423,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -501,10 +454,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload async def begin_update_patch( self, @@ -528,14 +477,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -548,7 +489,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -561,18 +502,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -585,7 +518,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -596,20 +529,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -644,7 +566,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -656,14 +578,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return AsyncLROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_gateway_custom_domains_operations.py index 6aa5c1be18b..f7138738500 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_gateway_route_configs_operations.py index fc36babd5c3..467f66371e7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -264,7 +245,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -283,18 +264,10 @@ async def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -309,7 +282,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -325,20 +298,9 @@ async def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -375,7 +337,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -385,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -416,23 +376,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +401,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +418,6 @@ async def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -501,7 +448,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -510,17 +457,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -535,7 +478,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -561,18 +503,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -583,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -600,11 +541,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -615,7 +556,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_gateways_operations.py index c3410536634..6bdf41d6209 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ async def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -100,22 +99,21 @@ async def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,20 +125,16 @@ async def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -177,16 +171,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -206,10 +199,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,24 +330,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_capacity_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> Optional[_models.GatewayResource]: error_map = { @@ -413,7 +373,7 @@ async def _update_capacity_initial( else: _json = self._serialize.body(gateway_capacity_resource, "SkuObject") - request = build_update_capacity_request( + _request = build_update_capacity_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -422,16 +382,15 @@ async def _update_capacity_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_capacity_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,13 +408,9 @@ async def _update_capacity_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_capacity_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore @overload async def begin_update_capacity( @@ -482,14 +437,6 @@ async def begin_update_capacity( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -503,7 +450,7 @@ async def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: IO, + gateway_capacity_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -518,18 +465,10 @@ async def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Required. - :type gateway_capacity_resource: IO + :type gateway_capacity_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -543,7 +482,7 @@ async def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Operation to update an exiting Spring Cloud Gateway capacity. @@ -556,20 +495,9 @@ async def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a - SkuObject type or a IO type. Required. + SkuObject type or a IO[bytes] type. Required. :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.SkuObject - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -605,7 +533,7 @@ async def begin_update_capacity( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -617,17 +545,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_capacity.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -648,22 +574,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -673,11 +598,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -692,14 +613,6 @@ async def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -729,7 +642,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -738,17 +651,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_env_secrets( @@ -763,7 +672,6 @@ async def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -784,22 +692,21 @@ async def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -811,13 +718,9 @@ async def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -838,22 +741,21 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -867,11 +769,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_restart( @@ -886,14 +784,6 @@ async def begin_restart( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -923,7 +813,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -934,17 +824,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -957,7 +843,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayResource] @@ -982,17 +867,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +887,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -1020,11 +904,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,10 +920,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload async def validate_domain( self, @@ -1066,7 +946,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1078,7 +957,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1093,11 +972,10 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1109,7 +987,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -1122,13 +1000,9 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1158,7 +1032,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1167,16 +1041,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1188,10 +1061,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_monitoring_settings_operations.py index de77a059d8e..b4276abaaa1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -346,23 +308,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -390,7 +350,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -398,16 +358,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,10 +386,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -454,14 +409,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -474,7 +421,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -487,18 +434,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -511,7 +450,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -522,20 +461,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +498,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -580,14 +508,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_operations.py index 378e310714b..6d39947b700 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_predefined_accelerators_operations.py index 4b8d293b2c1..391a42365ad 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace_async async def get( self, @@ -179,7 +173,6 @@ async def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -200,23 +193,22 @@ async def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,13 +220,9 @@ async def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore async def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -260,23 +248,22 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -286,11 +273,7 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_disable( @@ -312,14 +295,6 @@ async def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -350,7 +325,7 @@ async def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -359,17 +334,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -395,23 +366,22 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +391,7 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_enable( @@ -447,14 +413,6 @@ async def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -485,7 +443,7 @@ async def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -494,14 +452,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_runtime_versions_operations.py index 2056b0ac4e4..e6162c79dc7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_service_registries_operations.py index bd3a18d7e08..c6e60a358ef 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,13 +120,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -149,22 +143,21 @@ async def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -184,10 +177,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -201,14 +190,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -241,7 +222,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -251,17 +232,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -282,22 +261,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,11 +285,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -326,14 +300,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -363,7 +329,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -372,17 +338,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -395,7 +357,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -421,17 +382,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -442,14 +402,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -459,11 +419,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -474,7 +434,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_services_operations.py index fc59cb6c9a8..75c6558033a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,21 +106,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,16 +131,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -169,7 +167,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -177,16 +175,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -209,10 +206,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +228,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -255,7 +240,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +253,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -289,7 +266,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -299,19 +280,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -346,7 +316,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -356,17 +326,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -387,21 +355,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -411,11 +378,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -426,14 +389,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -462,7 +417,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -471,20 +426,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -511,7 +466,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -519,16 +474,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,10 +502,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -574,14 +524,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -594,7 +536,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -607,18 +549,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -628,7 +562,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -637,20 +575,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -685,7 +612,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -695,17 +622,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -716,7 +641,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -737,21 +661,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -763,13 +686,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -794,7 +713,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -805,7 +723,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -818,11 +736,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -833,7 +750,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -844,13 +761,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_09_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -880,7 +793,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -888,16 +801,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -909,13 +821,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -928,7 +836,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -949,21 +856,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -973,11 +879,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -990,7 +892,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1011,21 +912,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1037,13 +937,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1064,35 +960,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1103,14 +994,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1139,7 +1022,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1148,17 +1031,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1179,35 +1058,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1218,14 +1092,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1254,7 +1120,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1263,17 +1129,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1294,21 +1156,20 @@ async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-retur ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_flush_vnet_dns_setting_request( + _request = build_flush_vnet_dns_setting_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._flush_vnet_dns_setting_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1322,11 +1183,7 @@ async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-retur response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _flush_vnet_dns_setting_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_flush_vnet_dns_setting( @@ -1339,14 +1196,6 @@ async def begin_flush_vnet_dns_setting( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1375,7 +1224,7 @@ async def begin_flush_vnet_dns_setting( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1386,17 +1235,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_flush_vnet_dns_setting.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_supported_apm_types( @@ -1409,7 +1254,6 @@ def list_supported_apm_types( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedApmType or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.SupportedApmType] @@ -1434,17 +1278,16 @@ def list_supported_apm_types( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_apm_types_request( + _request = build_list_supported_apm_types_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_apm_types.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1455,14 +1298,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("SupportedApmTypes", pipeline_response) @@ -1472,11 +1315,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1488,10 +1331,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_supported_apm_types.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes" - } - @distributed_trace_async async def list_globally_enabled_apms( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1503,7 +1342,6 @@ async def list_globally_enabled_apms( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GloballyEnabledApms or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.GloballyEnabledApms :raises ~azure.core.exceptions.HttpResponseError: @@ -1524,21 +1362,20 @@ async def list_globally_enabled_apms( ) cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None) - request = build_list_globally_enabled_apms_request( + _request = build_list_globally_enabled_apms_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_globally_enabled_apms.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1550,16 +1387,12 @@ async def list_globally_enabled_apms( deserialized = self._deserialize("GloballyEnabledApms", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_globally_enabled_apms.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms" - } + return deserialized # type: ignore async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1586,7 +1419,7 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s else: _json = self._serialize.body(apm, "ApmReference") - request = build_enable_apm_globally_request( + _request = build_enable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1594,16 +1427,15 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s content_type=content_type, json=_json, content=_content, - template_url=self._enable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1617,11 +1449,7 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload async def begin_enable_apm_globally( @@ -1645,14 +1473,6 @@ async def begin_enable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1663,7 +1483,7 @@ async def begin_enable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1676,18 +1496,10 @@ async def begin_enable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the enable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1695,7 +1507,7 @@ async def begin_enable_apm_globally( @distributed_trace_async async def begin_enable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Enable an APM globally. @@ -1704,20 +1516,9 @@ async def begin_enable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the enable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the enable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmReference or IO[bytes] :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: @@ -1749,7 +1550,7 @@ async def begin_enable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1761,20 +1562,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1801,7 +1598,7 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(apm, "ApmReference") - request = build_disable_apm_globally_request( + _request = build_disable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1809,16 +1606,15 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._disable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1832,11 +1628,7 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload async def begin_disable_apm_globally( @@ -1860,14 +1652,6 @@ async def begin_disable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1878,7 +1662,7 @@ async def begin_disable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1891,18 +1675,10 @@ async def begin_disable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the disable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1910,7 +1686,7 @@ async def begin_disable_apm_globally( @distributed_trace_async async def begin_disable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Disable an APM globally. @@ -1919,20 +1695,9 @@ async def begin_disable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the disable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the disable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmReference or IO[bytes] :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: @@ -1964,7 +1729,7 @@ async def begin_disable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1976,17 +1741,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -2007,7 +1768,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2015,18 +1775,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2034,20 +1798,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_09_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2077,23 +1840,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2105,19 +1867,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceResource] @@ -2142,15 +1899,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2161,14 +1917,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2178,11 +1934,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2194,8 +1950,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -2203,7 +1957,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceResource] @@ -2228,16 +1981,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2248,14 +2000,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2265,11 +2017,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2281,10 +2033,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } - @distributed_trace def list_supported_server_versions( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -2296,7 +2044,6 @@ def list_supported_server_versions( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedServerVersion or the result of cls(response) :rtype: @@ -2322,17 +2069,16 @@ def list_supported_server_versions( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_server_versions_request( + _request = build_list_supported_server_versions_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_server_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2343,14 +2089,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("SupportedServerVersions", pipeline_response) @@ -2360,11 +2106,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2375,7 +2121,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list_supported_server_versions.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedServerVersions" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_skus_operations.py index 137e19a5ac2..8e9a131a929 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_storages_operations.py index ef76296488f..1055194f698 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -270,18 +251,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -295,7 +268,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -308,20 +281,9 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -357,7 +319,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -367,17 +329,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -398,22 +358,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -423,11 +382,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -442,14 +397,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -479,7 +426,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -488,17 +435,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -511,7 +454,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.StorageResource] @@ -536,17 +478,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -557,14 +498,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -574,11 +515,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,7 +530,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/models/_models_py3.py index d94d01d60a6..cd7441052c8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/models/_models_py3.py @@ -30,7 +30,7 @@ class AcceleratorAuthSetting(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AcceleratorBasicAuthSetting, AcceleratorPublicSetting, AcceleratorSshSetting - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -61,7 +61,7 @@ def __init__(self, **kwargs: Any) -> None: class AcceleratorBasicAuthSetting(AcceleratorAuthSetting): """Auth setting for basic auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -106,7 +106,7 @@ def __init__( class AcceleratorGitRepository(_serialization.Model): """AcceleratorGitRepository. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: Git repository URL for the accelerator. Required. :vartype url: str @@ -184,7 +184,7 @@ def __init__( class AcceleratorPublicSetting(AcceleratorAuthSetting): """Auth setting for public url. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -214,7 +214,7 @@ def __init__(self, *, ca_cert_resource_id: Optional[str] = None, **kwargs: Any) class AcceleratorSshSetting(AcceleratorAuthSetting): """Auth setting for SSH auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -354,24 +354,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2023_09_01_preview.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class ApiPortalCustomDomainResource(ProxyResource): """Custom domain of the API portal. @@ -684,7 +666,7 @@ class ApmProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: APM Type. Required. :vartype type: str @@ -736,7 +718,7 @@ def __init__( class ApmReference(_serialization.Model): """A reference to the APM. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of the APM. Required. :vartype resource_id: str @@ -1625,7 +1607,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -1687,7 +1669,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -2576,7 +2558,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2614,7 +2596,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2999,7 +2981,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3071,7 +3053,7 @@ def __init__(self, **kwargs: Any) -> None: class CertificateReference(_serialization.Model): """A reference to the certificate. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of the certificate. Required. :vartype resource_id: str @@ -3334,7 +3316,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -3644,7 +3626,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -3681,7 +3663,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -4027,7 +4009,7 @@ def __init__( self.git_property = git_property -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -4083,7 +4065,7 @@ class ContainerRegistryCredentials(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ContainerRegistryBasicCredentials - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The credential type of the container registry credentials. Required. :vartype type: str @@ -4108,7 +4090,7 @@ def __init__(self, **kwargs: Any) -> None: class ContainerRegistryBasicCredentials(ContainerRegistryCredentials): """The basic authentication properties for the container registry resource. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The credential type of the container registry credentials. Required. :vartype type: str @@ -4155,7 +4137,7 @@ class ContainerRegistryProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar credentials: The credentials of the container registry resource. Required. :vartype credentials: @@ -4295,7 +4277,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -4429,7 +4411,7 @@ def __init__( class CustomContainerUserSourceInfo(UserSourceInfo): """Custom container user source info. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4587,7 +4569,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -4641,7 +4623,7 @@ class CustomizedAcceleratorProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar provisioning_state: State of the customized accelerator. Known values are: "Creating", "Updating", "Succeeded", "Failed", and "Deleting". @@ -4850,7 +4832,7 @@ def __init__( class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -5834,7 +5816,7 @@ class ProbeAction(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ExecAction, HTTPGetAction, TCPSocketAction - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -5862,7 +5844,7 @@ def __init__(self, **kwargs: Any) -> None: class ExecAction(ProbeAction): """ExecAction describes a "run in container" action. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -6830,7 +6812,7 @@ def __init__( class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -6952,7 +6934,7 @@ def __init__(self, *, value: Optional[List[str]] = None, **kwargs: Any) -> None: class HTTPGetAction(ProbeAction): """HTTPGetAction describes an action based on HTTP Get requests. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -7181,7 +7163,7 @@ class UploadedUserSourceInfo(UserSourceInfo): JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo, WarUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7225,7 +7207,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7281,7 +7263,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -7386,7 +7368,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -7420,7 +7402,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -7488,7 +7470,7 @@ class MaintenanceScheduleConfiguration(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: WeeklyMaintenanceScheduleConfiguration - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar frequency: The frequency to run the maintenance job. Required. "Weekly" :vartype frequency: str or ~azure.mgmt.appplatform.v2023_09_01_preview.models.Frequency @@ -7902,7 +7884,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -7935,7 +7917,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -8420,7 +8402,7 @@ class Probe(_serialization.Model): """Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive traffic. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar probe_action: The action of the probe. :vartype probe_action: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ProbeAction @@ -8541,7 +8523,7 @@ def __init__( class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2023_09_01_preview.models.TestKeyType @@ -9584,7 +9566,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -9658,7 +9640,7 @@ def __init__(self, *, sku: Optional["_models.Sku"] = None, **kwargs: Any) -> Non class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -9799,7 +9781,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2023_09_01_preview.models.StorageType @@ -9824,7 +9806,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2023_09_01_preview.models.StorageType @@ -10409,7 +10391,7 @@ def __init__( class TCPSocketAction(ProbeAction): """TCPSocketAction describes an action based on opening a socket. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -10590,7 +10572,7 @@ def __init__(self, *, name: Optional[str] = None, messages: Optional[List[str]] class WarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded War binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -10653,7 +10635,7 @@ class WeeklyMaintenanceScheduleConfiguration(MaintenanceScheduleConfiguration): 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. + All required parameters must be populated in order to send to server. :ivar frequency: The frequency to run the maintenance job. Required. "Weekly" :vartype frequency: str or ~azure.mgmt.appplatform.v2023_09_01_preview.models.Frequency diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_api_portal_custom_domains_operations.py index e5c7f0d170d..94986b0c9e1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_api_portals_operations.py index 9ca7ebe5f97..d254628617a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -465,20 +438,9 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -524,17 +486,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -555,22 +515,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,11 +539,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -599,14 +554,6 @@ def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -636,7 +583,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,17 +592,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: @@ -666,7 +609,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.ApiPortalResource] @@ -691,17 +633,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -712,14 +653,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -729,11 +670,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -745,10 +686,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload def validate_domain( self, @@ -775,7 +712,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -787,7 +723,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -802,11 +738,10 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -818,7 +753,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -831,13 +766,9 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -867,7 +798,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -876,16 +807,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +827,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_apms_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_apms_operations.py index 477a39bd822..a7dfe8c40f0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_apms_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_apms_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -228,7 +228,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApmResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmResource] @@ -253,17 +252,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -274,14 +272,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApmResourceCollection", pipeline_response) @@ -291,11 +289,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,10 +305,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms" - } - @distributed_trace def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any) -> _models.ApmResource: """Get the APM by name. @@ -322,7 +316,6 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmResource :raises ~azure.core.exceptions.HttpResponseError: @@ -343,22 +336,21 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar ) cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -370,20 +362,16 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> _models.ApmResource: error_map = { @@ -411,7 +399,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(apm_resource, "ApmResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, @@ -420,16 +408,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,10 +436,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } - @overload def begin_create_or_update( self, @@ -478,14 +461,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -499,7 +474,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: IO, + apm_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -514,18 +489,10 @@ def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Required. - :type apm_resource: IO + :type apm_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -539,7 +506,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApmResource]: """Create or update an APM. @@ -552,19 +519,8 @@ def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Is either a ApmResource - type or a IO type. Required. - :type apm_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmResource or IO[bytes] :return: An instance of LROPoller that returns either ApmResource or the result of cls(response) :rtype: @@ -600,7 +556,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -610,17 +566,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApmResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return LROPoller[_models.ApmResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -641,22 +595,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -670,11 +623,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -689,14 +638,6 @@ def begin_delete( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_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: @@ -726,7 +667,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -737,17 +678,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_secret_keys( @@ -762,7 +699,6 @@ def list_secret_keys( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmSecretKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmSecretKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -783,22 +719,21 @@ def list_secret_keys( ) cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None) - request = build_list_secret_keys_request( + _request = build_list_secret_keys_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_secret_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -810,10 +745,6 @@ def list_secret_keys( deserialized = self._deserialize("ApmSecretKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_secret_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_application_accelerators_operations.py index de316cc1c63..468d1ed7b82 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -204,7 +204,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -230,17 +229,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -251,14 +249,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -268,11 +266,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -284,10 +282,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -301,7 +295,6 @@ def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -322,22 +315,21 @@ def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,20 +341,16 @@ def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -390,7 +378,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -399,16 +387,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,10 +415,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -459,14 +442,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -480,7 +455,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -496,18 +471,10 @@ def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -521,7 +488,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -534,20 +501,9 @@ def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -583,7 +539,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -593,17 +549,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -624,22 +578,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -649,11 +602,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -668,14 +617,6 @@ def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -705,7 +646,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -714,14 +655,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_application_live_views_operations.py index b8dff4df39c..3ce4077b387 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -198,7 +198,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -224,17 +223,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -245,14 +243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -262,11 +260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -278,10 +276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -295,7 +289,6 @@ def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -316,22 +309,21 @@ def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,20 +335,16 @@ def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -526,20 +493,9 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -616,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_apps_operations.py index cbda2048bdf..90f2d0518a1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -373,23 +372,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -401,20 +399,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -442,7 +436,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -451,16 +445,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -483,10 +476,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -512,14 +501,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -533,7 +514,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -548,18 +529,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -573,7 +546,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -586,19 +559,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -634,7 +596,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -644,17 +606,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -675,22 +635,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -700,11 +659,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -719,14 +674,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -756,7 +703,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -765,24 +712,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -810,7 +753,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -819,16 +762,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -848,10 +790,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -877,14 +815,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -898,7 +828,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -913,18 +843,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -938,7 +860,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -950,20 +872,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -999,7 +910,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1009,17 +920,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1030,7 +939,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.AppResource] @@ -1055,17 +963,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1076,14 +983,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1093,11 +1000,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1109,10 +1016,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1126,7 +1029,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1147,22 +1049,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,20 +1075,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1215,7 +1112,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1224,16 +1121,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1253,10 +1149,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1283,14 +1175,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1304,7 +1188,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1319,18 +1203,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1344,7 +1220,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1357,20 +1233,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1406,7 +1271,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1416,17 +1281,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1454,7 +1317,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1466,7 +1328,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1481,11 +1343,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1497,7 +1358,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1510,13 +1371,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1546,7 +1403,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1555,16 +1412,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,10 +1432,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_bindings_operations.py index 72dfa8a02e0..c0224d049e8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -871,20 +793,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.BindingResource] @@ -981,18 +889,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +910,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1020,11 +927,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1035,7 +942,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_build_service_agent_pool_operations.py index 407163ccef3..2d16c2031a3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -209,18 +208,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -231,14 +229,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -248,11 +246,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -264,10 +262,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -283,7 +277,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -304,23 +297,22 @@ def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -332,13 +324,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -346,7 +334,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -374,7 +362,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -384,16 +372,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -413,10 +400,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -446,14 +429,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -468,7 +443,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -485,18 +460,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -511,7 +478,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -526,20 +493,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -576,7 +532,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +542,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_build_service_builder_operations.py index 65bc63f775a..9babdf1c0ce 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -261,7 +261,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -282,23 +281,22 @@ def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -310,13 +308,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -324,7 +318,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -352,7 +346,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -362,16 +356,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -391,10 +384,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -423,14 +412,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -445,7 +426,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -462,18 +443,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -488,7 +461,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -503,20 +476,9 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -553,7 +515,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -563,17 +525,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -594,23 +554,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -620,11 +579,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -641,14 +596,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -679,7 +626,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -688,17 +635,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -713,7 +656,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.BuilderResource] @@ -738,18 +680,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -760,14 +701,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -777,11 +718,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,10 +734,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -812,7 +749,6 @@ def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -833,23 +769,22 @@ def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -861,10 +796,6 @@ def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_build_service_operations.py index 2a6e2171e7d..403b9d30d61 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -607,7 +607,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildService] @@ -632,17 +631,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -653,14 +651,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -670,11 +668,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -686,10 +684,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -703,7 +697,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -724,22 +717,21 @@ def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,20 +743,16 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> _models.BuildService: error_map = { @@ -792,7 +780,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(build_service, "BuildService") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -801,16 +789,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -830,10 +817,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } - @overload def begin_create_or_update( self, @@ -859,14 +842,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -880,7 +855,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: IO, + build_service: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -895,18 +870,10 @@ def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Required. - :type build_service: IO + :type build_service: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -920,7 +887,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildService]: """Create a build service resource. @@ -933,19 +900,9 @@ def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Is either a BuildService type or a - IO type. Required. - :type build_service: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildService or + IO[bytes] :return: An instance of LROPoller that returns either BuildService or the result of cls(response) :rtype: @@ -981,7 +938,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -993,17 +950,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildService].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return LROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_builds( @@ -1018,7 +973,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -1042,18 +996,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1064,14 +1017,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -1081,11 +1034,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1097,10 +1050,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1116,7 +1065,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1137,23 +1085,22 @@ def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1165,13 +1112,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -1201,7 +1144,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1214,7 +1156,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1231,11 +1173,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1248,7 +1189,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -1262,13 +1203,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2023_09_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2023_09_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1298,7 +1235,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1308,16 +1245,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1337,10 +1273,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - def _delete_build_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> None: @@ -1360,23 +1292,22 @@ def _delete_build_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_build_request( + _request = build_delete_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_build_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1390,11 +1321,7 @@ def _delete_build_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_build_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete_build( @@ -1411,14 +1338,6 @@ def begin_delete_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_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: @@ -1449,7 +1368,7 @@ def begin_delete_build( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1460,17 +1379,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_build_results( @@ -1487,7 +1402,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildResult] @@ -1512,19 +1426,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1535,14 +1448,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1552,11 +1465,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1568,10 +1481,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1595,7 +1504,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1616,7 +1524,7 @@ def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1624,16 +1532,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1645,13 +1552,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1676,7 +1579,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1697,7 +1599,7 @@ def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1705,16 +1607,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1726,13 +1627,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1747,7 +1644,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1768,22 +1664,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1795,13 +1690,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1816,7 +1707,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1837,22 +1727,21 @@ def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1864,13 +1753,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1887,7 +1772,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1908,23 +1792,22 @@ def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1936,13 +1819,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1957,7 +1836,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1978,22 +1856,21 @@ def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2005,13 +1882,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -2028,7 +1901,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -2049,23 +1921,22 @@ def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2077,10 +1948,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_buildpack_binding_operations.py index c7e1b21706d..a230478094a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -262,7 +262,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -288,17 +287,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -309,14 +307,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -326,11 +324,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -342,10 +340,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace def get( self, @@ -369,7 +363,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -390,7 +383,7 @@ def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -398,16 +391,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -419,13 +411,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -434,7 +422,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -462,7 +450,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -473,16 +461,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -502,10 +489,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -539,14 +522,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -562,7 +537,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -582,18 +557,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -609,7 +576,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -626,20 +593,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -677,7 +633,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -687,17 +643,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -724,7 +678,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -732,16 +686,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,11 +704,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -780,14 +729,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -819,7 +760,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -828,17 +769,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -855,7 +792,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -881,19 +817,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -904,14 +839,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -921,11 +856,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -936,7 +871,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_certificates_operations.py index 3c3066694bf..f6aa0729402 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -493,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -524,22 +484,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -549,11 +508,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -568,14 +523,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -605,7 +552,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -614,17 +561,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -637,7 +580,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.CertificateResource] @@ -662,17 +604,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -683,14 +624,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -700,11 +641,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -715,7 +656,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_config_servers_operations.py index 352ad768162..972c3f8a95e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -474,23 +436,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -518,7 +478,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -526,16 +486,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,10 +514,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -582,14 +537,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -602,7 +549,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -615,18 +562,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -639,7 +578,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -650,20 +589,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -698,7 +626,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -708,23 +636,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -752,7 +678,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -760,16 +686,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -789,10 +714,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -816,14 +737,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -836,7 +749,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -849,18 +762,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -873,7 +778,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -884,20 +789,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -932,7 +826,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -944,14 +838,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_configuration_services_operations.py index e8d90b08aaf..42c7903f070 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -280,7 +280,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -301,22 +300,21 @@ def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -328,20 +326,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -369,7 +363,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -378,16 +372,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -407,10 +400,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -438,14 +427,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -459,7 +440,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -475,18 +456,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -500,7 +473,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -514,20 +487,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -563,7 +525,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -573,17 +535,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -604,22 +564,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -629,11 +588,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -648,14 +603,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -685,7 +632,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -694,17 +641,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -717,7 +660,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -743,17 +685,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -764,14 +705,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -781,11 +722,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -797,16 +738,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -834,7 +771,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -843,16 +780,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -872,10 +808,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -901,14 +833,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -922,7 +846,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -937,18 +861,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -962,7 +878,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -975,20 +891,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1024,7 +929,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1036,24 +941,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_resource_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> Optional[_models.ConfigurationServiceSettingsValidateResult]: error_map = { @@ -1081,7 +984,7 @@ def _validate_resource_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_validate_resource_request( + _request = build_validate_resource_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -1090,16 +993,15 @@ def _validate_resource_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_resource_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1117,13 +1019,9 @@ def _validate_resource_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - _validate_resource_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return deserialized # type: ignore @overload def begin_validate_resource( @@ -1152,14 +1050,6 @@ def begin_validate_resource( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1173,7 +1063,7 @@ def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1189,18 +1079,10 @@ def begin_validate_resource( :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be validated. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1214,7 +1096,7 @@ def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service resource is valid. @@ -1227,20 +1109,9 @@ def begin_validate_resource( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be - validated. Is either a ConfigurationServiceResource type or a IO type. Required. + validated. Is either a ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1276,7 +1147,7 @@ def begin_validate_resource( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1288,14 +1159,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_resource.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_container_registries_operations.py index c5a542ee0d9..e3522a8e203 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_container_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_container_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -241,7 +241,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContainerRegistryResource or the result of cls(response) :rtype: @@ -267,17 +266,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -288,14 +286,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) @@ -305,11 +303,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +319,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -338,7 +332,6 @@ def get( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ContainerRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -359,22 +352,21 @@ def get( ) cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -386,20 +378,16 @@ def get( deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> _models.ContainerRegistryResource: error_map = { @@ -427,7 +415,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -436,16 +424,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -465,10 +452,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } - @overload def begin_create_or_update( self, @@ -495,14 +478,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -516,7 +491,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: IO, + container_registry_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -531,18 +506,10 @@ def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Required. - :type container_registry_resource: IO + :type container_registry_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -556,7 +523,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ContainerRegistryResource]: """Create or update container registry resource. @@ -569,20 +536,9 @@ def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Is either a - ContainerRegistryResource type or a IO type. Required. + ContainerRegistryResource type or a IO[bytes] type. Required. :type container_registry_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ContainerRegistryResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ContainerRegistryResource or IO[bytes] :return: An instance of LROPoller that returns either ContainerRegistryResource or the result of cls(response) :rtype: @@ -618,7 +574,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -630,17 +586,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ContainerRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return LROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -661,22 +615,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -690,11 +643,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -709,14 +658,6 @@ def begin_delete( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_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: @@ -746,7 +687,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -757,24 +698,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _validate_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.ContainerRegistryValidateResult]: error_map = { @@ -802,7 +739,7 @@ def _validate_initial( else: _json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -811,16 +748,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -838,13 +774,9 @@ def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return deserialized # type: ignore @overload def begin_validate( @@ -872,14 +804,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -893,7 +817,7 @@ def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: IO, + container_registry_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -908,18 +832,10 @@ def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Required. - :type container_registry_properties: IO + :type container_registry_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -933,7 +849,7 @@ def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ContainerRegistryValidateResult]: """Check if the container registry properties are valid. @@ -946,20 +862,9 @@ def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Is either a - ContainerRegistryProperties type or a IO type. Required. + ContainerRegistryProperties type or a IO[bytes] type. Required. :type container_registry_properties: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.ContainerRegistryProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.ContainerRegistryProperties or IO[bytes] :return: An instance of LROPoller that returns either ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -995,7 +900,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1007,14 +912,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ContainerRegistryValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return LROPoller[_models.ContainerRegistryValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_custom_domains_operations.py index 5f0119b3597..d9c51e2e2ab 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -871,20 +793,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -982,18 +890,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1004,14 +911,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1021,11 +928,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,7 +943,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_customized_accelerators_operations.py index 85e36c07458..332ea65f929 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -272,7 +272,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -298,18 +297,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -320,14 +318,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -337,11 +335,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +351,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace def get( self, @@ -377,7 +371,6 @@ def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -398,23 +391,22 @@ def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,13 +418,9 @@ def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -440,7 +428,7 @@ def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -468,7 +456,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -478,16 +466,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -507,10 +494,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -541,14 +524,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -563,7 +538,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +556,10 @@ def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -607,7 +574,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -622,20 +589,9 @@ def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -672,7 +628,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -682,17 +638,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -718,23 +672,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -744,11 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -770,14 +719,6 @@ def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -808,7 +749,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -817,17 +758,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def validate( @@ -858,7 +795,6 @@ def validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -872,7 +808,7 @@ def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -889,11 +825,10 @@ def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -907,7 +842,7 @@ def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -922,13 +857,9 @@ def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -959,7 +890,7 @@ def validate( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -969,16 +900,15 @@ def validate( content_type=content_type, json=_json, content=_content, - template_url=self.validate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -992,10 +922,6 @@ def validate( deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_deployments_operations.py index 3f2e0446660..78bb0739dc4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -474,7 +474,7 @@ def build_disable_remote_debugging_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_remote_debugging_config_request( +def build_get_remote_debugging_config_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, app_name: str, @@ -708,7 +708,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -729,23 +728,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -757,13 +755,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -771,7 +765,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -799,7 +793,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -809,16 +803,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -841,10 +834,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -874,14 +863,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -896,7 +877,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -913,18 +894,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -939,7 +912,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -954,20 +927,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1004,7 +966,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1014,17 +976,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1045,23 +1005,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1071,11 +1030,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -1092,14 +1047,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1130,7 +1077,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1139,17 +1086,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1157,7 +1100,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1185,7 +1128,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1195,16 +1138,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1224,10 +1166,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1257,14 +1195,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1279,7 +1209,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1296,18 +1226,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1322,7 +1244,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1337,20 +1259,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1387,7 +1298,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1397,17 +1308,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1432,7 +1341,6 @@ def list( :type version: list[str] :param expand: The expand expression to apply on the operation. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentResource] @@ -1457,7 +1365,7 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1465,12 +1373,11 @@ def prepare_request(next_link=None): version=version, expand=expand, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1481,14 +1388,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1498,11 +1405,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1514,10 +1421,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, @@ -1538,7 +1441,6 @@ def list_for_cluster( :type version: list[str] :param expand: The expand expression to apply on the operation. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.DeploymentResource] @@ -1563,19 +1465,18 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, expand=expand, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1586,14 +1487,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1603,11 +1504,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1619,10 +1520,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1642,23 +1539,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1668,11 +1564,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1689,14 +1581,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1727,7 +1611,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1736,17 +1620,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1767,23 +1647,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1793,11 +1672,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1814,14 +1689,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1852,7 +1719,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1861,17 +1728,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1892,23 +1755,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1918,11 +1780,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1939,14 +1797,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1977,7 +1827,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1986,17 +1836,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_remote_debugging_initial( self, @@ -2004,7 +1850,7 @@ def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -2035,7 +1881,7 @@ def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2045,16 +1891,15 @@ def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2074,10 +1919,6 @@ def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload def begin_enable_remote_debugging( self, @@ -2107,14 +1948,6 @@ def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2129,7 +1962,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2146,18 +1979,10 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2172,7 +1997,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> LROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -2187,20 +2012,9 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of LROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -2237,7 +2051,7 @@ def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2247,17 +2061,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2278,23 +2090,22 @@ def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2314,10 +2125,6 @@ def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2333,14 +2140,6 @@ def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -2374,7 +2173,7 @@ def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2384,17 +2183,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def get_remote_debugging_config( @@ -2411,7 +2208,6 @@ def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -2432,23 +2228,22 @@ def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2460,13 +2255,9 @@ def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace def get_log_file_url( @@ -2483,7 +2274,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -2504,23 +2294,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2534,13 +2323,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2548,7 +2333,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2576,7 +2361,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2586,16 +2371,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2605,11 +2389,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2640,14 +2420,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2660,7 +2432,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2677,18 +2449,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2701,7 +2465,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2716,20 +2480,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2763,7 +2516,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2772,17 +2525,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2790,7 +2539,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2818,7 +2567,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2828,16 +2577,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2847,11 +2595,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2882,14 +2626,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2902,7 +2638,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2919,18 +2655,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2943,7 +2671,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2958,20 +2686,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -3005,7 +2722,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3014,17 +2731,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -3032,7 +2745,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -3060,7 +2773,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -3070,16 +2783,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -3089,11 +2801,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -3124,14 +2832,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -3144,7 +2844,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -3161,18 +2861,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -3185,7 +2877,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -3200,20 +2892,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -3247,7 +2928,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3256,14 +2937,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_dev_tool_portals_operations.py index d82d907e023..8745b37b836 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -198,7 +198,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -224,17 +223,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -245,14 +243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -262,11 +260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -278,10 +276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -295,7 +289,6 @@ def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -316,22 +309,21 @@ def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,20 +335,16 @@ def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -526,20 +493,9 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of LROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -616,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_eureka_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_eureka_servers_operations.py index d7f08bdeba1..3cd19c0cdbd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_eureka_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_eureka_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -194,7 +194,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResourceCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.EurekaServerResourceCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -215,21 +214,20 @@ def list( ) cls: ClsType[_models.EurekaServerResourceCollection] = kwargs.pop("cls", None) - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -241,13 +239,9 @@ def list( deserialized = self._deserialize("EurekaServerResourceCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers" - } + return deserialized # type: ignore @distributed_trace def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.EurekaServerResource: @@ -258,7 +252,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.EurekaServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -279,21 +272,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -305,19 +297,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -345,7 +333,7 @@ def _update_put_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -353,16 +341,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -385,10 +372,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload def begin_update_put( self, @@ -412,14 +395,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -432,7 +407,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -445,18 +420,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -469,7 +436,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -480,20 +447,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of LROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -528,7 +484,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -540,23 +496,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return LROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -584,7 +538,7 @@ def _update_patch_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -592,16 +546,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -624,10 +577,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload def begin_update_patch( self, @@ -651,14 +600,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -671,7 +612,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -684,18 +625,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -708,7 +641,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -719,20 +652,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of LROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -767,7 +689,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -779,14 +701,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return LROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_gateway_custom_domains_operations.py index cc71c2e9ee4..4c84735c5ed 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_gateway_route_configs_operations.py index a445beda6a3..bbd5cc3ed3d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload def begin_create_or_update( self, @@ -388,14 +377,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -410,7 +391,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -429,18 +410,10 @@ def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -471,20 +444,9 @@ def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -521,7 +483,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -531,17 +493,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -562,23 +522,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,11 +547,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -609,14 +564,6 @@ def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -647,7 +594,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -656,17 +603,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -681,7 +624,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -707,18 +649,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -729,14 +670,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -746,11 +687,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -761,7 +702,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_gateways_operations.py index 6be7b3cb12f..1f427d1e4ef 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -334,7 +334,6 @@ def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -355,22 +354,21 @@ def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -382,20 +380,16 @@ def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -423,7 +417,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -432,16 +426,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -461,10 +454,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload def begin_create_or_update( self, @@ -490,14 +479,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -511,7 +492,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -526,18 +507,10 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -551,7 +524,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -564,20 +537,9 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -613,7 +575,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -623,24 +585,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_capacity_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> Optional[_models.GatewayResource]: error_map = { @@ -668,7 +628,7 @@ def _update_capacity_initial( else: _json = self._serialize.body(gateway_capacity_resource, "SkuObject") - request = build_update_capacity_request( + _request = build_update_capacity_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -677,16 +637,15 @@ def _update_capacity_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_capacity_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -704,13 +663,9 @@ def _update_capacity_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_capacity_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore @overload def begin_update_capacity( @@ -737,14 +692,6 @@ def begin_update_capacity( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -758,7 +705,7 @@ def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: IO, + gateway_capacity_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -773,18 +720,10 @@ def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Required. - :type gateway_capacity_resource: IO + :type gateway_capacity_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -798,7 +737,7 @@ def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Operation to update an exiting Spring Cloud Gateway capacity. @@ -811,20 +750,9 @@ def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a - SkuObject type or a IO type. Required. + SkuObject type or a IO[bytes] type. Required. :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.SkuObject - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -860,7 +788,7 @@ def begin_update_capacity( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -872,17 +800,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_capacity.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -903,22 +829,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -928,11 +853,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -947,14 +868,6 @@ def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -984,7 +897,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -993,17 +906,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_env_secrets( @@ -1018,7 +927,6 @@ def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -1039,22 +947,21 @@ def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1066,13 +973,9 @@ def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -1093,22 +996,21 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1122,11 +1024,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_restart( @@ -1141,14 +1039,6 @@ def begin_restart( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -1178,7 +1068,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1189,17 +1079,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: @@ -1210,7 +1096,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.GatewayResource] @@ -1235,17 +1120,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1256,14 +1140,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -1273,11 +1157,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1289,10 +1173,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload def validate_domain( self, @@ -1319,7 +1199,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1331,7 +1210,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1346,11 +1225,10 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1362,7 +1240,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -1375,13 +1253,9 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1411,7 +1285,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1420,16 +1294,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1441,10 +1314,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_monitoring_settings_operations.py index a29343ba236..84ce63706da 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -440,23 +402,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -484,7 +444,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -492,16 +452,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -521,10 +480,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -548,14 +503,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -568,7 +515,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +528,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -605,7 +544,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -616,20 +555,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_09_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -664,7 +592,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -674,14 +602,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_operations.py index 45cc7068e36..c788e60eac8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_predefined_accelerators_operations.py index 4667abb960d..52dbfeb089b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -225,7 +225,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -251,18 +250,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -273,14 +271,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -290,11 +288,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +304,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace def get( self, @@ -330,7 +324,6 @@ def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -351,23 +344,22 @@ def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -379,13 +371,9 @@ def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -411,23 +399,22 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +424,7 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_disable( @@ -463,14 +446,6 @@ def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -501,7 +476,7 @@ def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -510,17 +485,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -546,23 +517,22 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -572,11 +542,7 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_enable( @@ -598,14 +564,6 @@ def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -636,7 +594,7 @@ def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,14 +603,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_runtime_versions_operations.py index d7718370edf..5b452e89ad5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_service_registries_operations.py index b8fd811040e..1a25f24ccc3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -217,22 +216,21 @@ def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,13 +242,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -271,22 +265,21 @@ def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +299,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -323,14 +312,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -373,17 +354,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -404,22 +383,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,11 +407,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -448,14 +422,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -485,7 +451,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -494,17 +460,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -517,7 +479,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -543,17 +504,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -581,11 +541,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +556,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_services_operations.py index 43625128d75..a7d2c5c6e96 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -598,7 +598,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_supported_server_versions_request( +def build_list_supported_server_versions_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -658,7 +658,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -679,21 +678,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -705,16 +703,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -741,7 +739,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -749,16 +747,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -781,10 +778,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -807,14 +800,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -827,7 +812,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -840,18 +825,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -861,7 +838,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -871,19 +852,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -918,7 +888,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -928,17 +898,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -959,21 +927,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -983,11 +950,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -998,14 +961,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1034,7 +989,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1043,20 +998,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -1083,7 +1038,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1091,16 +1046,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1120,10 +1074,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -1146,14 +1096,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1166,7 +1108,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1179,18 +1121,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1200,7 +1134,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1209,20 +1147,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1257,7 +1184,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1267,17 +1194,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1288,7 +1213,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1309,21 +1233,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1335,13 +1258,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1366,7 +1285,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1377,7 +1295,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1390,11 +1308,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1405,7 +1322,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1416,13 +1333,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_09_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1452,7 +1365,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1460,16 +1373,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1481,13 +1393,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1500,7 +1408,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1521,21 +1428,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1545,11 +1451,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1560,7 +1462,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1581,21 +1482,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1607,13 +1507,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1634,35 +1530,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1673,14 +1564,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1709,7 +1592,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1718,17 +1601,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1749,35 +1628,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1788,14 +1662,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1824,7 +1690,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1833,17 +1699,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1864,21 +1726,20 @@ def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-stat ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_flush_vnet_dns_setting_request( + _request = build_flush_vnet_dns_setting_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._flush_vnet_dns_setting_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1892,11 +1753,7 @@ def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-stat response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _flush_vnet_dns_setting_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_flush_vnet_dns_setting( @@ -1909,14 +1766,6 @@ def begin_flush_vnet_dns_setting( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1945,7 +1794,7 @@ def begin_flush_vnet_dns_setting( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1956,17 +1805,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_flush_vnet_dns_setting.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_supported_apm_types( @@ -1979,7 +1824,6 @@ def list_supported_apm_types( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedApmType or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.SupportedApmType] @@ -2004,17 +1848,16 @@ def list_supported_apm_types( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_apm_types_request( + _request = build_list_supported_apm_types_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_apm_types.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2025,14 +1868,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("SupportedApmTypes", pipeline_response) @@ -2042,11 +1885,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2058,10 +1901,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_supported_apm_types.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes" - } - @distributed_trace def list_globally_enabled_apms( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -2073,7 +1912,6 @@ def list_globally_enabled_apms( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GloballyEnabledApms or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.GloballyEnabledApms :raises ~azure.core.exceptions.HttpResponseError: @@ -2094,21 +1932,20 @@ def list_globally_enabled_apms( ) cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None) - request = build_list_globally_enabled_apms_request( + _request = build_list_globally_enabled_apms_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_globally_enabled_apms.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2120,16 +1957,12 @@ def list_globally_enabled_apms( deserialized = self._deserialize("GloballyEnabledApms", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_globally_enabled_apms.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms" - } + return deserialized # type: ignore def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -2156,7 +1989,7 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme else: _json = self._serialize.body(apm, "ApmReference") - request = build_enable_apm_globally_request( + _request = build_enable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -2164,16 +1997,15 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme content_type=content_type, json=_json, content=_content, - template_url=self._enable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2187,11 +2019,7 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload def begin_enable_apm_globally( @@ -2215,14 +2043,6 @@ def begin_enable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2233,7 +2053,7 @@ def begin_enable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2246,18 +2066,10 @@ def begin_enable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the enable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2265,7 +2077,7 @@ def begin_enable_apm_globally( @distributed_trace def begin_enable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Enable an APM globally. @@ -2274,20 +2086,9 @@ def begin_enable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the enable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the enable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmReference or IO[bytes] :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: @@ -2319,7 +2120,7 @@ def begin_enable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2330,20 +2131,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -2370,7 +2167,7 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(apm, "ApmReference") - request = build_disable_apm_globally_request( + _request = build_disable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -2378,16 +2175,15 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._disable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2401,11 +2197,7 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload def begin_disable_apm_globally( @@ -2429,14 +2221,6 @@ def begin_disable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2447,7 +2231,7 @@ def begin_disable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2460,18 +2244,10 @@ def begin_disable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the disable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2479,7 +2255,7 @@ def begin_disable_apm_globally( @distributed_trace def begin_disable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Disable an APM globally. @@ -2488,20 +2264,9 @@ def begin_disable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the disable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the disable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_09_01_preview.models.ApmReference or IO[bytes] :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: @@ -2533,7 +2298,7 @@ def begin_disable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2544,17 +2309,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -2575,7 +2336,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2583,18 +2343,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2602,20 +2366,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2023_09_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_09_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2645,23 +2408,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2673,19 +2435,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceResource] @@ -2710,15 +2467,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2729,14 +2485,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2746,11 +2502,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2762,8 +2518,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -2771,7 +2525,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.ServiceResource] @@ -2796,16 +2549,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2816,14 +2568,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2833,11 +2585,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2849,10 +2601,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } - @distributed_trace def list_supported_server_versions( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -2864,7 +2612,6 @@ def list_supported_server_versions( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedServerVersion or the result of cls(response) :rtype: @@ -2890,17 +2637,16 @@ def list_supported_server_versions( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_server_versions_request( + _request = build_list_supported_server_versions_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_server_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2911,14 +2657,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("SupportedServerVersions", pipeline_response) @@ -2928,11 +2674,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2943,7 +2689,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list_supported_server_versions.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedServerVersions" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_skus_operations.py index 063193933a6..089f89d0094 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_storages_operations.py index abcb2b0c512..e4ae4180f0b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_09_01_preview/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_09_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -359,14 +348,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -380,7 +361,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -395,18 +376,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -420,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -433,20 +406,9 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2023_09_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -482,7 +444,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -492,17 +454,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -523,22 +483,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +507,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -567,14 +522,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -604,7 +551,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -613,17 +560,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -634,7 +577,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_09_01_preview.models.StorageResource] @@ -659,17 +601,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -680,14 +621,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -697,11 +638,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -712,7 +653,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/_app_platform_management_client.py index 7d06489512f..0b608ad1709 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -166,7 +168,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -260,7 +280,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2023-11-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -280,7 +300,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/_configuration.py index 3971acf5ae0..9b869db0d95 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-11-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/_app_platform_management_client.py index 17528c53c49..2332ecdc5f6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -166,7 +168,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -260,7 +280,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2023-11-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -280,7 +302,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/_configuration.py index d889ebae1cc..c687fc1c4f7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-11-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_api_portal_custom_domains_operations.py index 9e70e9e1983..1cb514249eb 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_api_portals_operations.py index a00615b1ddb..03e865384ea 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -365,17 +327,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -396,22 +356,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -440,14 +395,6 @@ async def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -477,7 +424,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -486,17 +433,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -509,7 +452,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.ApiPortalResource] @@ -534,17 +476,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -555,14 +496,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -572,11 +513,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +529,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload async def validate_domain( self, @@ -618,7 +555,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -630,7 +566,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -645,11 +581,10 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -661,7 +596,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -674,13 +609,9 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -710,7 +641,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -719,16 +650,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,10 +670,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_apms_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_apms_operations.py index fb68ad64ca1..704321efea0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_apms_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_apms_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -72,7 +72,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApmResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmResource] @@ -97,17 +96,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -118,14 +116,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApmResourceCollection", pipeline_response) @@ -135,11 +133,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -151,10 +149,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -168,7 +162,6 @@ async def get( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmResource :raises ~azure.core.exceptions.HttpResponseError: @@ -189,22 +182,21 @@ async def get( ) cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -216,20 +208,16 @@ async def get( deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> _models.ApmResource: error_map = { @@ -257,7 +245,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(apm_resource, "ApmResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, @@ -266,16 +254,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -295,10 +282,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } - @overload async def begin_create_or_update( self, @@ -324,14 +307,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -345,7 +320,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: IO, + apm_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -360,18 +335,10 @@ async def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Required. - :type apm_resource: IO + :type apm_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -385,7 +352,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApmResource]: """Create or update an APM. @@ -398,19 +365,8 @@ async def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Is either a ApmResource - type or a IO type. Required. - :type apm_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApmResource or the result of cls(response) :rtype: @@ -446,7 +402,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -456,17 +412,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApmResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return AsyncLROPoller[_models.ApmResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -487,22 +441,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -583,17 +524,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_secret_keys( @@ -608,7 +545,6 @@ async def list_secret_keys( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmSecretKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmSecretKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -629,22 +565,21 @@ async def list_secret_keys( ) cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None) - request = build_list_secret_keys_request( + _request = build_list_secret_keys_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_secret_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -656,10 +591,6 @@ async def list_secret_keys( deserialized = self._deserialize("ApmSecretKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_secret_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_application_accelerators_operations.py index 967c076b7b3..ce70d132b0e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -328,14 +311,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -349,7 +324,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -365,18 +340,10 @@ async def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -390,7 +357,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -403,20 +370,9 @@ async def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -452,7 +408,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -462,17 +418,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -493,22 +447,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -518,11 +471,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -537,14 +486,6 @@ async def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -574,7 +515,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -583,14 +524,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_application_live_views_operations.py index 19b9bab1ecd..2bf6c5f6920 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -581,14 +522,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_apps_operations.py index a17e4d75985..5f110d5dd9e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,20 +133,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -176,7 +170,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -185,16 +179,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -217,10 +210,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -246,14 +235,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -267,7 +248,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -320,19 +293,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -368,7 +330,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -378,17 +340,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -409,22 +369,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,11 +393,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -453,14 +408,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -490,7 +437,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -499,24 +446,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -544,7 +487,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -553,16 +496,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,10 +524,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -611,14 +549,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -632,7 +562,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -647,18 +577,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -672,7 +594,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -684,20 +606,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -733,7 +644,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -743,17 +654,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -764,7 +673,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.AppResource] @@ -789,17 +697,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -810,14 +717,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -827,11 +734,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -843,10 +750,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -860,7 +763,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -881,22 +783,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -908,20 +809,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -949,7 +846,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -958,16 +855,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -987,10 +883,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -1017,14 +909,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1038,7 +922,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1053,18 +937,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1078,7 +954,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1091,20 +967,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1140,7 +1005,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1150,17 +1015,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1188,7 +1051,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1200,7 +1062,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1215,11 +1077,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1231,7 +1092,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1244,13 +1105,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1280,7 +1137,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1289,16 +1146,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1310,10 +1166,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_bindings_operations.py index 087f4768013..9bec964d779 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -705,20 +627,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.BindingResource] @@ -815,18 +723,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -837,14 +744,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -854,11 +761,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -869,7 +776,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_build_service_agent_pool_operations.py index 7b89ffb0758..46ecf93e28d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -174,7 +168,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -195,23 +188,22 @@ async def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -223,13 +215,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -237,7 +225,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -265,7 +253,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -275,16 +263,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -304,10 +291,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -337,14 +320,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -359,7 +334,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +351,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -402,7 +369,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -417,20 +384,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -467,7 +423,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -477,14 +433,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_build_service_builder_operations.py index eed9c675699..6ec3812b205 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,10 +201,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -240,14 +229,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -262,7 +243,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -279,18 +260,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -305,7 +278,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -320,20 +293,9 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -370,7 +332,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -380,17 +342,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -411,23 +371,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +396,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -458,14 +413,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -496,7 +443,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -505,17 +452,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -530,7 +473,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.BuilderResource] @@ -555,18 +497,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -577,14 +518,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -594,11 +535,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -610,10 +551,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace_async async def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -629,7 +566,6 @@ async def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -650,23 +586,22 @@ async def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -678,10 +613,6 @@ async def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_build_service_operations.py index 7477ce4b732..03a1dba8f65 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildService] @@ -109,17 +108,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -130,14 +128,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -147,11 +145,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -163,10 +161,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -180,7 +174,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -201,22 +194,21 @@ async def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,20 +220,16 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> _models.BuildService: error_map = { @@ -269,7 +257,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(build_service, "BuildService") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -278,16 +266,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,10 +294,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } - @overload async def begin_create_or_update( self, @@ -336,14 +319,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -357,7 +332,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: IO, + build_service: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -372,18 +347,10 @@ async def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Required. - :type build_service: IO + :type build_service: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -397,7 +364,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildService]: """Create a build service resource. @@ -410,19 +377,9 @@ async def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Is either a BuildService type or a - IO type. Required. - :type build_service: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildService or + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildService or the result of cls(response) :rtype: @@ -458,7 +415,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -470,17 +427,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildService].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return AsyncLROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_builds( @@ -495,7 +450,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.Build] @@ -520,18 +474,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -542,14 +495,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -559,11 +512,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -575,10 +528,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -594,7 +543,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -615,23 +563,22 @@ async def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -643,13 +590,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -679,7 +622,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -692,7 +634,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -709,11 +651,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -726,7 +667,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -740,13 +681,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2023_11_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2023_11_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -776,7 +713,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -786,16 +723,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -815,10 +751,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - async def _delete_build_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> None: @@ -838,23 +770,22 @@ async def _delete_build_initial( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_build_request( + _request = build_delete_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_build_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -868,11 +799,7 @@ async def _delete_build_initial( # pylint: disable=inconsistent-return-statemen response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_build_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete_build( @@ -889,14 +816,6 @@ async def begin_delete_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_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: @@ -927,7 +846,7 @@ async def begin_delete_build( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -938,17 +857,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_build_results( @@ -965,7 +880,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildResult] @@ -990,19 +904,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1013,14 +926,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1030,11 +943,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1046,10 +959,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -1073,7 +982,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1094,7 +1002,7 @@ async def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1102,16 +1010,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1123,13 +1030,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -1154,7 +1057,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1175,7 +1077,7 @@ async def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1183,16 +1085,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1204,13 +1105,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -1225,7 +1122,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1246,22 +1142,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1273,13 +1168,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -1294,7 +1185,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1315,22 +1205,21 @@ async def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1342,13 +1231,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -1365,7 +1250,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1386,23 +1270,22 @@ async def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1414,13 +1297,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1435,7 +1314,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1456,22 +1334,21 @@ async def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1483,13 +1360,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1506,7 +1379,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1527,23 +1399,22 @@ async def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1555,10 +1426,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_buildpack_binding_operations.py index 972a274dac3..0c30e4f7575 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -100,17 +99,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -121,14 +119,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -138,11 +136,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,10 +152,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,7 +195,7 @@ async def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -210,16 +203,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -231,13 +223,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -246,7 +234,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -274,7 +262,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -285,16 +273,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -314,10 +301,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -351,14 +334,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -374,7 +349,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -394,18 +369,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -421,7 +388,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -438,20 +405,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -489,7 +445,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -499,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -536,7 +490,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -544,16 +498,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -563,11 +516,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -592,14 +541,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -631,7 +572,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -640,17 +581,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -667,7 +604,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -693,19 +629,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -716,14 +651,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -733,11 +668,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -748,7 +683,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_certificates_operations.py index 5ba60842da7..4ad4043f1a9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,17 +330,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -399,22 +359,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,11 +383,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -443,14 +398,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -489,17 +436,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -512,7 +455,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.CertificateResource] @@ -537,17 +479,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -558,14 +499,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -575,11 +516,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -590,7 +531,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_config_servers_operations.py index f0c8efc0a0a..379c0b4d33c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -345,23 +307,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -389,7 +349,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -397,16 +357,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,10 +385,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -453,14 +408,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -473,7 +420,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -486,18 +433,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -510,7 +449,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -521,20 +460,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -569,7 +497,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -579,23 +507,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -623,7 +549,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -631,16 +557,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -660,10 +585,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -687,14 +608,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -707,7 +620,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -720,18 +633,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -744,7 +649,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -755,20 +660,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -803,7 +697,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -815,14 +709,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_configuration_services_operations.py index 8109fb9b72f..99408d5d385 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,22 +97,21 @@ async def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,20 +123,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -166,7 +160,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -204,10 +197,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -272,18 +253,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -297,7 +270,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -311,20 +284,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -360,7 +322,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -370,17 +332,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -401,22 +361,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,11 +385,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -445,14 +400,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -482,7 +429,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -491,17 +438,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -514,7 +457,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -540,17 +482,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -561,14 +502,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -578,11 +519,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -594,16 +535,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -631,7 +568,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -640,16 +577,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -669,10 +605,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -698,14 +630,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -719,7 +643,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -734,18 +658,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -759,7 +675,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -772,20 +688,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -821,7 +726,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -833,24 +738,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_resource_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> Optional[_models.ConfigurationServiceSettingsValidateResult]: error_map = { @@ -878,7 +781,7 @@ async def _validate_resource_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_validate_resource_request( + _request = build_validate_resource_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -887,16 +790,15 @@ async def _validate_resource_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_resource_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -914,13 +816,9 @@ async def _validate_resource_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _validate_resource_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return deserialized # type: ignore @overload async def begin_validate_resource( @@ -949,14 +847,6 @@ async def begin_validate_resource( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -970,7 +860,7 @@ async def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -986,18 +876,10 @@ async def begin_validate_resource( :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be validated. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1011,7 +893,7 @@ async def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service resource is valid. @@ -1024,20 +906,9 @@ async def begin_validate_resource( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be - validated. Is either a ConfigurationServiceResource type or a IO type. Required. + validated. Is either a ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1073,7 +944,7 @@ async def begin_validate_resource( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1085,14 +956,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_resource.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_container_registries_operations.py index f69ed9a7260..55330226b23 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_container_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_container_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContainerRegistryResource or the result of cls(response) :rtype: @@ -100,17 +99,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -121,14 +119,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) @@ -138,11 +136,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,10 +152,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -171,7 +165,6 @@ async def get( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ContainerRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -192,22 +185,21 @@ async def get( ) cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -219,20 +211,16 @@ async def get( deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> _models.ContainerRegistryResource: error_map = { @@ -260,7 +248,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -269,16 +257,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -298,10 +285,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } - @overload async def begin_create_or_update( self, @@ -328,14 +311,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -349,7 +324,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: IO, + container_registry_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -364,18 +339,10 @@ async def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Required. - :type container_registry_resource: IO + :type container_registry_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -389,7 +356,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ContainerRegistryResource]: """Create or update container registry resource. @@ -402,20 +369,9 @@ async def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Is either a - ContainerRegistryResource type or a IO type. Required. + ContainerRegistryResource type or a IO[bytes] type. Required. :type container_registry_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ContainerRegistryResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ContainerRegistryResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the result of cls(response) :rtype: @@ -451,7 +407,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -463,17 +419,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ContainerRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return AsyncLROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -494,22 +448,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -523,11 +476,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -542,14 +491,6 @@ async def begin_delete( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_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: @@ -579,7 +520,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -590,24 +531,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _validate_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.ContainerRegistryValidateResult]: error_map = { @@ -635,7 +572,7 @@ async def _validate_initial( else: _json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -644,16 +581,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -671,13 +607,9 @@ async def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return deserialized # type: ignore @overload async def begin_validate( @@ -705,14 +637,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -726,7 +650,7 @@ async def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: IO, + container_registry_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -741,18 +665,10 @@ async def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Required. - :type container_registry_properties: IO + :type container_registry_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -766,7 +682,7 @@ async def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]: """Check if the container registry properties are valid. @@ -779,20 +695,9 @@ async def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Is either a - ContainerRegistryProperties type or a IO type. Required. + ContainerRegistryProperties type or a IO[bytes] type. Required. :type container_registry_properties: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ContainerRegistryProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ContainerRegistryProperties or IO[bytes] :return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -828,7 +733,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -840,14 +745,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ContainerRegistryValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return AsyncLROPoller[_models.ContainerRegistryValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_custom_domains_operations.py index 9d460f84349..2fd93617da8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -705,20 +627,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -816,18 +724,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -838,14 +745,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -855,11 +762,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -870,7 +777,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_customized_accelerators_operations.py index c53503bdf98..b5f678e8472 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -102,18 +101,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -124,14 +122,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -141,11 +139,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,10 +155,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,23 +195,22 @@ async def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -230,13 +222,9 @@ async def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -244,7 +232,7 @@ async def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -272,7 +260,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -282,16 +270,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -311,10 +298,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -345,14 +328,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -367,7 +342,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -385,18 +360,10 @@ async def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -411,7 +378,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -426,20 +393,9 @@ async def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -476,7 +432,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -486,17 +442,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -522,23 +476,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +501,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -574,14 +523,6 @@ async def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -612,7 +553,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -621,17 +562,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def validate( @@ -662,7 +599,6 @@ async def validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -676,7 +612,7 @@ async def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -693,11 +629,10 @@ async def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -711,7 +646,7 @@ async def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -726,13 +661,9 @@ async def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -763,7 +694,7 @@ async def validate( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -773,16 +704,15 @@ async def validate( content_type=content_type, json=_json, content=_content, - template_url=self.validate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -796,10 +726,6 @@ async def validate( deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_deployments_operations.py index df3e29b8d1c..307f87c1ff1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -89,7 +89,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -110,23 +109,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -138,13 +136,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -152,7 +146,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -180,7 +174,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -190,16 +184,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -222,10 +215,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -255,14 +244,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -277,7 +258,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -294,18 +275,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -320,7 +293,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -335,20 +308,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -385,7 +347,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -395,17 +357,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -426,23 +386,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -452,11 +411,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -473,14 +428,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -511,7 +458,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -520,17 +467,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -538,7 +481,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -566,7 +509,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -576,16 +519,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -605,10 +547,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -638,14 +576,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -660,7 +590,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -677,18 +607,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -703,7 +625,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -718,20 +640,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -768,7 +679,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -778,17 +689,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -813,7 +722,6 @@ def list( :type version: list[str] :param expand: The expand expression to apply on the operation. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentResource] @@ -838,7 +746,7 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -846,12 +754,11 @@ def prepare_request(next_link=None): version=version, expand=expand, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -862,14 +769,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -879,11 +786,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -895,10 +802,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, @@ -919,7 +822,6 @@ def list_for_cluster( :type version: list[str] :param expand: The expand expression to apply on the operation. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentResource] @@ -944,19 +846,18 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, expand=expand, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -967,14 +868,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -984,11 +885,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1000,10 +901,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1023,23 +920,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1049,11 +945,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1070,14 +962,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1108,7 +992,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1117,17 +1001,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1148,23 +1028,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,11 +1053,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1195,14 +1070,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1233,7 +1100,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1242,17 +1109,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1273,23 +1136,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1299,11 +1161,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1320,14 +1178,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1358,7 +1208,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1367,17 +1217,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_remote_debugging_initial( self, @@ -1385,7 +1231,7 @@ async def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -1416,7 +1262,7 @@ async def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1426,16 +1272,15 @@ async def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1455,10 +1300,6 @@ async def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload async def begin_enable_remote_debugging( self, @@ -1488,14 +1329,6 @@ async def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1510,7 +1343,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1527,18 +1360,10 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1553,7 +1378,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> AsyncLROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -1568,20 +1393,9 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -1618,7 +1432,7 @@ async def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1628,17 +1442,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1659,23 +1471,22 @@ async def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1695,10 +1506,6 @@ async def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace_async async def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1714,14 +1521,6 @@ async def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -1755,7 +1554,7 @@ async def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1765,17 +1564,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def get_remote_debugging_config( @@ -1792,7 +1589,6 @@ async def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -1813,23 +1609,22 @@ async def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1841,13 +1636,9 @@ async def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1864,7 +1655,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1885,23 +1675,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1915,13 +1704,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1929,7 +1714,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1957,7 +1742,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1967,16 +1752,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1986,11 +1770,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -2021,14 +1801,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2041,7 +1813,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2058,18 +1830,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2082,7 +1846,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -2097,20 +1861,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2144,7 +1897,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2153,17 +1906,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2171,7 +1920,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2199,7 +1948,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2209,16 +1958,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2228,11 +1976,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -2263,14 +2007,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2283,7 +2019,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2300,18 +2036,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2324,7 +2052,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -2339,20 +2067,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2386,7 +2103,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2395,17 +2112,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2413,7 +2126,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2441,7 +2154,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2451,16 +2164,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2470,11 +2182,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2505,14 +2213,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2525,7 +2225,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2542,18 +2242,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2566,7 +2258,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2581,20 +2273,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2628,7 +2309,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2637,14 +2318,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_dev_tool_portals_operations.py index 01380cbd827..b490318d0f5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -581,14 +522,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_eureka_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_eureka_servers_operations.py index 307cf3f8494..6bbe8f8854d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_eureka_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_eureka_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -70,7 +70,6 @@ async def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResourceCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.EurekaServerResourceCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -91,21 +90,20 @@ async def list( ) cls: ClsType[_models.EurekaServerResourceCollection] = kwargs.pop("cls", None) - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -117,13 +115,9 @@ async def list( deserialized = self._deserialize("EurekaServerResourceCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers" - } + return deserialized # type: ignore @distributed_trace_async async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.EurekaServerResource: @@ -134,7 +128,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.EurekaServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -155,21 +148,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -181,19 +173,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -221,7 +209,7 @@ async def _update_put_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -229,16 +217,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -261,10 +248,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload async def begin_update_put( self, @@ -288,14 +271,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -308,7 +283,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -321,18 +296,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -345,7 +312,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -356,20 +323,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -404,7 +360,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -417,23 +373,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return AsyncLROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -461,7 +415,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -469,16 +423,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -501,10 +454,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload async def begin_update_patch( self, @@ -528,14 +477,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -548,7 +489,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -561,18 +502,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -585,7 +518,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -596,20 +529,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -644,7 +566,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -656,14 +578,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return AsyncLROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_gateway_custom_domains_operations.py index 799ee5cac05..ec4886a7f8c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_gateway_route_configs_operations.py index ea424b39c87..935d3985099 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -264,7 +245,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -283,18 +264,10 @@ async def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -309,7 +282,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -325,20 +298,9 @@ async def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -375,7 +337,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -385,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -416,23 +376,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +401,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +418,6 @@ async def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -501,7 +448,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -510,17 +457,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -535,7 +478,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -561,18 +503,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -583,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -600,11 +541,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -615,7 +556,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_gateways_operations.py index 0217dbdc1cd..3baa321d2fd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ async def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -100,22 +99,21 @@ async def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,20 +125,16 @@ async def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -177,16 +171,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -206,10 +199,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,24 +330,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_capacity_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> Optional[_models.GatewayResource]: error_map = { @@ -413,7 +373,7 @@ async def _update_capacity_initial( else: _json = self._serialize.body(gateway_capacity_resource, "SkuObject") - request = build_update_capacity_request( + _request = build_update_capacity_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -422,16 +382,15 @@ async def _update_capacity_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_capacity_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,13 +408,9 @@ async def _update_capacity_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_capacity_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore @overload async def begin_update_capacity( @@ -482,14 +437,6 @@ async def begin_update_capacity( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -503,7 +450,7 @@ async def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: IO, + gateway_capacity_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -518,18 +465,10 @@ async def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Required. - :type gateway_capacity_resource: IO + :type gateway_capacity_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -543,7 +482,7 @@ async def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Operation to update an exiting Spring Cloud Gateway capacity. @@ -556,20 +495,9 @@ async def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a - SkuObject type or a IO type. Required. + SkuObject type or a IO[bytes] type. Required. :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.SkuObject - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -605,7 +533,7 @@ async def begin_update_capacity( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -617,17 +545,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_capacity.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -648,22 +574,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -673,11 +598,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -692,14 +613,6 @@ async def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -729,7 +642,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -738,17 +651,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_env_secrets( @@ -763,7 +672,6 @@ async def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -784,22 +692,21 @@ async def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -811,13 +718,9 @@ async def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -838,22 +741,21 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -867,11 +769,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_restart( @@ -886,14 +784,6 @@ async def begin_restart( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -923,7 +813,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -934,17 +824,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -957,7 +843,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayResource] @@ -982,17 +867,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +887,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -1020,11 +904,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,10 +920,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload async def validate_domain( self, @@ -1066,7 +946,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1078,7 +957,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1093,11 +972,10 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1109,7 +987,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -1122,13 +1000,9 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1158,7 +1032,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1167,16 +1041,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1188,10 +1061,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_monitoring_settings_operations.py index fbec583f8bb..e8d80622a48 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -346,23 +308,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -390,7 +350,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -398,16 +358,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,10 +386,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -454,14 +409,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -474,7 +421,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -487,18 +434,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -511,7 +450,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -522,20 +461,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +498,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -580,14 +508,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_operations.py index 386570a5a1f..ccc9d303e0a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_predefined_accelerators_operations.py index 185ab45d8bd..6645951488c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace_async async def get( self, @@ -179,7 +173,6 @@ async def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -200,23 +193,22 @@ async def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,13 +220,9 @@ async def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore async def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -260,23 +248,22 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -286,11 +273,7 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_disable( @@ -312,14 +295,6 @@ async def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -350,7 +325,7 @@ async def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -359,17 +334,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -395,23 +366,22 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +391,7 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_enable( @@ -447,14 +413,6 @@ async def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -485,7 +443,7 @@ async def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -494,14 +452,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_runtime_versions_operations.py index f6b6aaa56a0..49113b24979 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_service_registries_operations.py index 86d2f07086f..72035d9e079 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,13 +120,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -149,22 +143,21 @@ async def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -184,10 +177,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -201,14 +190,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -241,7 +222,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -251,17 +232,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -282,22 +261,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,11 +285,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -326,14 +300,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -363,7 +329,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -372,17 +338,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -395,7 +357,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -421,17 +382,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -442,14 +402,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -459,11 +419,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -474,7 +434,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_services_operations.py index 2bd84ed3ba8..c0f9e8d7c77 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,21 +106,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,16 +131,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -169,7 +167,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -177,16 +175,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -209,10 +206,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +228,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -255,7 +240,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +253,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -289,7 +266,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -299,19 +280,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -346,7 +316,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -356,17 +326,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -387,21 +355,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -411,11 +378,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -426,14 +389,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -462,7 +417,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -471,20 +426,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -511,7 +466,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -519,16 +474,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,10 +502,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -574,14 +524,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -594,7 +536,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -607,18 +549,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -628,7 +562,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -637,20 +575,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -685,7 +612,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -695,17 +622,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -716,7 +641,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -737,21 +661,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -763,13 +686,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -794,7 +713,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -805,7 +723,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -818,11 +736,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -833,7 +750,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -844,13 +761,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_11_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -880,7 +793,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -888,16 +801,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -909,13 +821,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -928,7 +836,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -949,21 +856,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -973,11 +879,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -990,7 +892,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1011,21 +912,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1037,13 +937,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1064,35 +960,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1103,14 +994,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1139,7 +1022,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1148,17 +1031,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1179,35 +1058,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1218,14 +1092,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1254,7 +1120,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1263,17 +1129,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1294,21 +1156,20 @@ async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-retur ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_flush_vnet_dns_setting_request( + _request = build_flush_vnet_dns_setting_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._flush_vnet_dns_setting_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1322,11 +1183,7 @@ async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-retur response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _flush_vnet_dns_setting_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_flush_vnet_dns_setting( @@ -1339,14 +1196,6 @@ async def begin_flush_vnet_dns_setting( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1375,7 +1224,7 @@ async def begin_flush_vnet_dns_setting( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1386,17 +1235,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_flush_vnet_dns_setting.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_supported_apm_types( @@ -1409,7 +1254,6 @@ def list_supported_apm_types( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedApmType or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.SupportedApmType] @@ -1434,17 +1278,16 @@ def list_supported_apm_types( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_apm_types_request( + _request = build_list_supported_apm_types_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_apm_types.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1455,14 +1298,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("SupportedApmTypes", pipeline_response) @@ -1472,11 +1315,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1488,10 +1331,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_supported_apm_types.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes" - } - @distributed_trace_async async def list_globally_enabled_apms( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1503,7 +1342,6 @@ async def list_globally_enabled_apms( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GloballyEnabledApms or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.GloballyEnabledApms :raises ~azure.core.exceptions.HttpResponseError: @@ -1524,21 +1362,20 @@ async def list_globally_enabled_apms( ) cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None) - request = build_list_globally_enabled_apms_request( + _request = build_list_globally_enabled_apms_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_globally_enabled_apms.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1550,16 +1387,12 @@ async def list_globally_enabled_apms( deserialized = self._deserialize("GloballyEnabledApms", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_globally_enabled_apms.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms" - } + return deserialized # type: ignore async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1586,7 +1419,7 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s else: _json = self._serialize.body(apm, "ApmReference") - request = build_enable_apm_globally_request( + _request = build_enable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1594,16 +1427,15 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s content_type=content_type, json=_json, content=_content, - template_url=self._enable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1617,11 +1449,7 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload async def begin_enable_apm_globally( @@ -1645,14 +1473,6 @@ async def begin_enable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1663,7 +1483,7 @@ async def begin_enable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1676,18 +1496,10 @@ async def begin_enable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the enable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1695,7 +1507,7 @@ async def begin_enable_apm_globally( @distributed_trace_async async def begin_enable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Enable an APM globally. @@ -1704,20 +1516,9 @@ async def begin_enable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the enable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the enable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmReference or IO[bytes] :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: @@ -1749,7 +1550,7 @@ async def begin_enable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1761,20 +1562,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1801,7 +1598,7 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(apm, "ApmReference") - request = build_disable_apm_globally_request( + _request = build_disable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1809,16 +1606,15 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._disable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1832,11 +1628,7 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload async def begin_disable_apm_globally( @@ -1860,14 +1652,6 @@ async def begin_disable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1878,7 +1662,7 @@ async def begin_disable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1891,18 +1675,10 @@ async def begin_disable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the disable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1910,7 +1686,7 @@ async def begin_disable_apm_globally( @distributed_trace_async async def begin_disable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Disable an APM globally. @@ -1919,20 +1695,9 @@ async def begin_disable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the disable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the disable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmReference or IO[bytes] :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: @@ -1964,7 +1729,7 @@ async def begin_disable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1976,17 +1741,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -2007,7 +1768,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2015,18 +1775,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2034,20 +1798,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_11_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2077,23 +1840,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2105,19 +1867,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceResource] @@ -2142,15 +1899,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2161,14 +1917,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2178,11 +1934,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2194,8 +1950,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -2203,7 +1957,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceResource] @@ -2228,16 +1981,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2248,14 +2000,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2265,11 +2017,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2281,10 +2033,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } - @distributed_trace def list_supported_server_versions( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -2296,7 +2044,6 @@ def list_supported_server_versions( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedServerVersion or the result of cls(response) :rtype: @@ -2322,17 +2069,16 @@ def list_supported_server_versions( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_server_versions_request( + _request = build_list_supported_server_versions_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_server_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2343,14 +2089,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("SupportedServerVersions", pipeline_response) @@ -2360,11 +2106,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2375,7 +2121,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list_supported_server_versions.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedServerVersions" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_skus_operations.py index fa2b682b2e5..5414fdf5ae8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_storages_operations.py index 76889bbc6b9..d3e2ca8aa20 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -270,18 +251,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -295,7 +268,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -308,20 +281,9 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -357,7 +319,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -367,17 +329,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -398,22 +358,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -423,11 +382,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -442,14 +397,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -479,7 +426,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -488,17 +435,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -511,7 +454,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.StorageResource] @@ -536,17 +478,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -557,14 +498,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -574,11 +515,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,7 +530,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/models/_models_py3.py index ddae809b196..49cda2ab61c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/models/_models_py3.py @@ -30,7 +30,7 @@ class AcceleratorAuthSetting(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AcceleratorBasicAuthSetting, AcceleratorPublicSetting, AcceleratorSshSetting - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -61,7 +61,7 @@ def __init__(self, **kwargs: Any) -> None: class AcceleratorBasicAuthSetting(AcceleratorAuthSetting): """Auth setting for basic auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -106,7 +106,7 @@ def __init__( class AcceleratorGitRepository(_serialization.Model): """AcceleratorGitRepository. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: Git repository URL for the accelerator. Required. :vartype url: str @@ -184,7 +184,7 @@ def __init__( class AcceleratorPublicSetting(AcceleratorAuthSetting): """Auth setting for public url. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -214,7 +214,7 @@ def __init__(self, *, ca_cert_resource_id: Optional[str] = None, **kwargs: Any) class AcceleratorSshSetting(AcceleratorAuthSetting): """Auth setting for SSH auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -354,24 +354,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2023_11_01_preview.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class ApiPortalCustomDomainResource(ProxyResource): """Custom domain of the API portal. @@ -699,7 +681,7 @@ class ApmProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: APM Type. Required. :vartype type: str @@ -751,7 +733,7 @@ def __init__( class ApmReference(_serialization.Model): """A reference to the APM. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of the APM. Required. :vartype resource_id: str @@ -1640,7 +1622,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -1702,7 +1684,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -2591,7 +2573,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2629,7 +2611,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -3014,7 +2996,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3086,7 +3068,7 @@ def __init__(self, **kwargs: Any) -> None: class CertificateReference(_serialization.Model): """A reference to the certificate. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of the certificate. Required. :vartype resource_id: str @@ -3349,7 +3331,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -3659,7 +3641,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -3696,7 +3678,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -4042,7 +4024,7 @@ def __init__( self.git_property = git_property -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -4098,7 +4080,7 @@ class ContainerRegistryCredentials(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ContainerRegistryBasicCredentials - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The credential type of the container registry credentials. Required. :vartype type: str @@ -4123,7 +4105,7 @@ def __init__(self, **kwargs: Any) -> None: class ContainerRegistryBasicCredentials(ContainerRegistryCredentials): """The basic authentication properties for the container registry resource. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The credential type of the container registry credentials. Required. :vartype type: str @@ -4170,7 +4152,7 @@ class ContainerRegistryProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar credentials: The credentials of the container registry resource. Required. :vartype credentials: @@ -4310,7 +4292,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -4444,7 +4426,7 @@ def __init__( class CustomContainerUserSourceInfo(UserSourceInfo): """Custom container user source info. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4602,7 +4584,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -4656,7 +4638,7 @@ class CustomizedAcceleratorProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar provisioning_state: State of the customized accelerator. Known values are: "Creating", "Updating", "Succeeded", "Failed", and "Deleting". @@ -4865,7 +4847,7 @@ def __init__( class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -5849,7 +5831,7 @@ class ProbeAction(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ExecAction, HTTPGetAction, TCPSocketAction - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -5877,7 +5859,7 @@ def __init__(self, **kwargs: Any) -> None: class ExecAction(ProbeAction): """ExecAction describes a "run in container" action. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -6278,7 +6260,7 @@ class GatewayResponseCacheProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: GatewayLocalResponseCachePerInstanceProperties, GatewayLocalResponseCachePerRouteProperties - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar response_cache_type: The type of the response cache. Required. :vartype response_cache_type: str @@ -6305,10 +6287,10 @@ def __init__(self, **kwargs: Any) -> None: self.response_cache_type: Optional[str] = None -class GatewayLocalResponseCachePerInstanceProperties(GatewayResponseCacheProperties): +class GatewayLocalResponseCachePerInstanceProperties(GatewayResponseCacheProperties): # pylint: disable=name-too-long """Spring Cloud Gateway local response cache per instance properties. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar response_cache_type: The type of the response cache. Required. :vartype response_cache_type: str @@ -6343,10 +6325,10 @@ def __init__(self, *, size: Optional[str] = None, time_to_live: Optional[str] = self.time_to_live = time_to_live -class GatewayLocalResponseCachePerRouteProperties(GatewayResponseCacheProperties): +class GatewayLocalResponseCachePerRouteProperties(GatewayResponseCacheProperties): # pylint: disable=name-too-long """Spring Cloud Gateway local response cache per route properties. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar response_cache_type: The type of the response cache. Required. :vartype response_cache_type: str @@ -6965,7 +6947,7 @@ def __init__( class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -7087,7 +7069,7 @@ def __init__(self, *, value: Optional[List[str]] = None, **kwargs: Any) -> None: class HTTPGetAction(ProbeAction): """HTTPGetAction describes an action based on HTTP Get requests. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -7316,7 +7298,7 @@ class UploadedUserSourceInfo(UserSourceInfo): JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo, WarUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7360,7 +7342,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7416,7 +7398,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -7521,7 +7503,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -7555,7 +7537,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -7623,7 +7605,7 @@ class MaintenanceScheduleConfiguration(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: WeeklyMaintenanceScheduleConfiguration - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar frequency: The frequency to run the maintenance job. Required. "Weekly" :vartype frequency: str or ~azure.mgmt.appplatform.v2023_11_01_preview.models.Frequency @@ -8037,7 +8019,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -8070,7 +8052,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -8555,7 +8537,7 @@ class Probe(_serialization.Model): """Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive traffic. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar probe_action: The action of the probe. :vartype probe_action: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ProbeAction @@ -8676,7 +8658,7 @@ def __init__( class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2023_11_01_preview.models.TestKeyType @@ -9719,7 +9701,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -9793,7 +9775,7 @@ def __init__(self, *, sku: Optional["_models.Sku"] = None, **kwargs: Any) -> Non class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -9934,7 +9916,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2023_11_01_preview.models.StorageType @@ -9959,7 +9941,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2023_11_01_preview.models.StorageType @@ -10544,7 +10526,7 @@ def __init__( class TCPSocketAction(ProbeAction): """TCPSocketAction describes an action based on opening a socket. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -10770,7 +10752,7 @@ def __init__(self, *, name: Optional[str] = None, messages: Optional[List[str]] class WarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded War binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -10833,7 +10815,7 @@ class WeeklyMaintenanceScheduleConfiguration(MaintenanceScheduleConfiguration): 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. + All required parameters must be populated in order to send to server. :ivar frequency: The frequency to run the maintenance job. Required. "Weekly" :vartype frequency: str or ~azure.mgmt.appplatform.v2023_11_01_preview.models.Frequency diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_api_portal_custom_domains_operations.py index a84def7ea60..99012d1df55 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_api_portals_operations.py index 0e7e71374af..268e7ccf64e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -465,20 +438,9 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -524,17 +486,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -555,22 +515,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,11 +539,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -599,14 +554,6 @@ def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -636,7 +583,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,17 +592,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: @@ -666,7 +609,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.ApiPortalResource] @@ -691,17 +633,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -712,14 +653,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -729,11 +670,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -745,10 +686,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload def validate_domain( self, @@ -775,7 +712,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -787,7 +723,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -802,11 +738,10 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -818,7 +753,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -831,13 +766,9 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -867,7 +798,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -876,16 +807,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +827,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_apms_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_apms_operations.py index b200c7d93c2..79a9b48ddb4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_apms_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_apms_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -228,7 +228,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApmResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmResource] @@ -253,17 +252,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -274,14 +272,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApmResourceCollection", pipeline_response) @@ -291,11 +289,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,10 +305,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms" - } - @distributed_trace def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any) -> _models.ApmResource: """Get the APM by name. @@ -322,7 +316,6 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmResource :raises ~azure.core.exceptions.HttpResponseError: @@ -343,22 +336,21 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar ) cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -370,20 +362,16 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> _models.ApmResource: error_map = { @@ -411,7 +399,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(apm_resource, "ApmResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, @@ -420,16 +408,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,10 +436,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } - @overload def begin_create_or_update( self, @@ -478,14 +461,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -499,7 +474,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: IO, + apm_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -514,18 +489,10 @@ def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Required. - :type apm_resource: IO + :type apm_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -539,7 +506,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApmResource]: """Create or update an APM. @@ -552,19 +519,8 @@ def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Is either a ApmResource - type or a IO type. Required. - :type apm_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmResource or IO[bytes] :return: An instance of LROPoller that returns either ApmResource or the result of cls(response) :rtype: @@ -600,7 +556,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -610,17 +566,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApmResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return LROPoller[_models.ApmResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -641,22 +595,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -670,11 +623,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -689,14 +638,6 @@ def begin_delete( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_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: @@ -726,7 +667,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -737,17 +678,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_secret_keys( @@ -762,7 +699,6 @@ def list_secret_keys( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmSecretKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmSecretKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -783,22 +719,21 @@ def list_secret_keys( ) cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None) - request = build_list_secret_keys_request( + _request = build_list_secret_keys_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_secret_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -810,10 +745,6 @@ def list_secret_keys( deserialized = self._deserialize("ApmSecretKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_secret_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_application_accelerators_operations.py index 76dd6443fe5..744cfabe407 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -204,7 +204,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -230,17 +229,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -251,14 +249,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -268,11 +266,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -284,10 +282,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -301,7 +295,6 @@ def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -322,22 +315,21 @@ def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,20 +341,16 @@ def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -390,7 +378,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -399,16 +387,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,10 +415,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -459,14 +442,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -480,7 +455,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -496,18 +471,10 @@ def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -521,7 +488,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -534,20 +501,9 @@ def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -583,7 +539,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -593,17 +549,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -624,22 +578,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -649,11 +602,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -668,14 +617,6 @@ def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -705,7 +646,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -714,14 +655,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_application_live_views_operations.py index 9096d81293d..46eb3bed0eb 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -198,7 +198,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -224,17 +223,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -245,14 +243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -262,11 +260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -278,10 +276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -295,7 +289,6 @@ def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -316,22 +309,21 @@ def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,20 +335,16 @@ def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -526,20 +493,9 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -616,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_apps_operations.py index fa469e857e4..fade2000c8b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -373,23 +372,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -401,20 +399,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -442,7 +436,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -451,16 +445,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -483,10 +476,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -512,14 +501,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -533,7 +514,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -548,18 +529,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -573,7 +546,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -586,19 +559,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -634,7 +596,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -644,17 +606,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -675,22 +635,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -700,11 +659,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -719,14 +674,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -756,7 +703,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -765,24 +712,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -810,7 +753,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -819,16 +762,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -848,10 +790,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -877,14 +815,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -898,7 +828,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -913,18 +843,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -938,7 +860,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -950,20 +872,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -999,7 +910,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1009,17 +920,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1030,7 +939,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.AppResource] @@ -1055,17 +963,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1076,14 +983,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1093,11 +1000,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1109,10 +1016,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1126,7 +1029,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1147,22 +1049,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,20 +1075,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1215,7 +1112,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1224,16 +1121,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1253,10 +1149,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1283,14 +1175,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1304,7 +1188,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1319,18 +1203,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1344,7 +1220,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1357,20 +1233,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1406,7 +1271,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1416,17 +1281,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1454,7 +1317,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1466,7 +1328,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1481,11 +1343,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1497,7 +1358,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1510,13 +1371,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1546,7 +1403,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1555,16 +1412,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,10 +1432,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_bindings_operations.py index d7fab85f0cc..1234c3e9b38 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -871,20 +793,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.BindingResource] @@ -981,18 +889,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +910,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1020,11 +927,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1035,7 +942,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_build_service_agent_pool_operations.py index a2c26a03dd9..d4202e9aaa0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -209,18 +208,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -231,14 +229,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -248,11 +246,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -264,10 +262,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -283,7 +277,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -304,23 +297,22 @@ def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -332,13 +324,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -346,7 +334,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -374,7 +362,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -384,16 +372,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -413,10 +400,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -446,14 +429,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -468,7 +443,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -485,18 +460,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -511,7 +478,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -526,20 +493,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -576,7 +532,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +542,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_build_service_builder_operations.py index d487d453509..b49119bfb92 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -261,7 +261,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -282,23 +281,22 @@ def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -310,13 +308,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -324,7 +318,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -352,7 +346,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -362,16 +356,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -391,10 +384,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -423,14 +412,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -445,7 +426,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -462,18 +443,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -488,7 +461,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -503,20 +476,9 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -553,7 +515,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -563,17 +525,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -594,23 +554,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -620,11 +579,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -641,14 +596,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -679,7 +626,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -688,17 +635,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -713,7 +656,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.BuilderResource] @@ -738,18 +680,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -760,14 +701,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -777,11 +718,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,10 +734,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -812,7 +749,6 @@ def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -833,23 +769,22 @@ def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -861,10 +796,6 @@ def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_build_service_operations.py index 7bc46b25dfe..d52a323d48d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -607,7 +607,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildService] @@ -632,17 +631,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -653,14 +651,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -670,11 +668,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -686,10 +684,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -703,7 +697,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -724,22 +717,21 @@ def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,20 +743,16 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> _models.BuildService: error_map = { @@ -792,7 +780,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(build_service, "BuildService") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -801,16 +789,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -830,10 +817,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } - @overload def begin_create_or_update( self, @@ -859,14 +842,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -880,7 +855,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: IO, + build_service: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -895,18 +870,10 @@ def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Required. - :type build_service: IO + :type build_service: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -920,7 +887,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildService]: """Create a build service resource. @@ -933,19 +900,9 @@ def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Is either a BuildService type or a - IO type. Required. - :type build_service: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildService or + IO[bytes] :return: An instance of LROPoller that returns either BuildService or the result of cls(response) :rtype: @@ -981,7 +938,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -993,17 +950,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildService].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return LROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_builds( @@ -1018,7 +973,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -1042,18 +996,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1064,14 +1017,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -1081,11 +1034,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1097,10 +1050,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1116,7 +1065,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1137,23 +1085,22 @@ def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1165,13 +1112,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -1201,7 +1144,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1214,7 +1156,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1231,11 +1173,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1248,7 +1189,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -1262,13 +1203,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2023_11_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2023_11_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1298,7 +1235,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1308,16 +1245,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1337,10 +1273,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - def _delete_build_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> None: @@ -1360,23 +1292,22 @@ def _delete_build_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_build_request( + _request = build_delete_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_build_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1390,11 +1321,7 @@ def _delete_build_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_build_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete_build( @@ -1411,14 +1338,6 @@ def begin_delete_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_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: @@ -1449,7 +1368,7 @@ def begin_delete_build( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1460,17 +1379,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_build_results( @@ -1487,7 +1402,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildResult] @@ -1512,19 +1426,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1535,14 +1448,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1552,11 +1465,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1568,10 +1481,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1595,7 +1504,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1616,7 +1524,7 @@ def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1624,16 +1532,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1645,13 +1552,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1676,7 +1579,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1697,7 +1599,7 @@ def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1705,16 +1607,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1726,13 +1627,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1747,7 +1644,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1768,22 +1664,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1795,13 +1690,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1816,7 +1707,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1837,22 +1727,21 @@ def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1864,13 +1753,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1887,7 +1772,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1908,23 +1792,22 @@ def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1936,13 +1819,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1957,7 +1836,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1978,22 +1856,21 @@ def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2005,13 +1882,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -2028,7 +1901,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -2049,23 +1921,22 @@ def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2077,10 +1948,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_buildpack_binding_operations.py index abb19b942d9..616940d0a6e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -262,7 +262,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -288,17 +287,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -309,14 +307,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -326,11 +324,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -342,10 +340,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace def get( self, @@ -369,7 +363,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -390,7 +383,7 @@ def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -398,16 +391,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -419,13 +411,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -434,7 +422,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -462,7 +450,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -473,16 +461,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -502,10 +489,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -539,14 +522,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -562,7 +537,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -582,18 +557,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -609,7 +576,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -626,20 +593,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -677,7 +633,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -687,17 +643,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -724,7 +678,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -732,16 +686,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,11 +704,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -780,14 +729,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -819,7 +760,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -828,17 +769,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -855,7 +792,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -881,19 +817,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -904,14 +839,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -921,11 +856,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -936,7 +871,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_certificates_operations.py index c0ca0256839..782948284f7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -493,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -524,22 +484,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -549,11 +508,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -568,14 +523,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -605,7 +552,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -614,17 +561,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -637,7 +580,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.CertificateResource] @@ -662,17 +604,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -683,14 +624,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -700,11 +641,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -715,7 +656,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_config_servers_operations.py index adc2d2f5546..6b4bf519da0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -474,23 +436,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -518,7 +478,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -526,16 +486,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,10 +514,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -582,14 +537,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -602,7 +549,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -615,18 +562,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -639,7 +578,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -650,20 +589,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -698,7 +626,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -708,23 +636,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -752,7 +678,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -760,16 +686,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -789,10 +714,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -816,14 +737,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -836,7 +749,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -849,18 +762,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -873,7 +778,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -884,20 +789,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -932,7 +826,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -944,14 +838,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_configuration_services_operations.py index 93b37f146b2..3012bec88a5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -280,7 +280,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -301,22 +300,21 @@ def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -328,20 +326,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -369,7 +363,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -378,16 +372,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -407,10 +400,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -438,14 +427,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -459,7 +440,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -475,18 +456,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -500,7 +473,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -514,20 +487,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -563,7 +525,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -573,17 +535,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -604,22 +564,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -629,11 +588,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -648,14 +603,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -685,7 +632,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -694,17 +641,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -717,7 +660,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -743,17 +685,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -764,14 +705,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -781,11 +722,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -797,16 +738,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -834,7 +771,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -843,16 +780,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -872,10 +808,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -901,14 +833,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -922,7 +846,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -937,18 +861,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -962,7 +878,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -975,20 +891,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1024,7 +929,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1036,24 +941,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_resource_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> Optional[_models.ConfigurationServiceSettingsValidateResult]: error_map = { @@ -1081,7 +984,7 @@ def _validate_resource_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_validate_resource_request( + _request = build_validate_resource_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -1090,16 +993,15 @@ def _validate_resource_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_resource_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1117,13 +1019,9 @@ def _validate_resource_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - _validate_resource_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return deserialized # type: ignore @overload def begin_validate_resource( @@ -1152,14 +1050,6 @@ def begin_validate_resource( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1173,7 +1063,7 @@ def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1189,18 +1079,10 @@ def begin_validate_resource( :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be validated. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1214,7 +1096,7 @@ def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service resource is valid. @@ -1227,20 +1109,9 @@ def begin_validate_resource( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be - validated. Is either a ConfigurationServiceResource type or a IO type. Required. + validated. Is either a ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1276,7 +1147,7 @@ def begin_validate_resource( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1288,14 +1159,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_resource.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_container_registries_operations.py index cf20d34f240..42a7cb5c6a3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_container_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_container_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -241,7 +241,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContainerRegistryResource or the result of cls(response) :rtype: @@ -267,17 +266,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -288,14 +286,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) @@ -305,11 +303,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +319,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -338,7 +332,6 @@ def get( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ContainerRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -359,22 +352,21 @@ def get( ) cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -386,20 +378,16 @@ def get( deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> _models.ContainerRegistryResource: error_map = { @@ -427,7 +415,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -436,16 +424,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -465,10 +452,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } - @overload def begin_create_or_update( self, @@ -495,14 +478,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -516,7 +491,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: IO, + container_registry_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -531,18 +506,10 @@ def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Required. - :type container_registry_resource: IO + :type container_registry_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -556,7 +523,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ContainerRegistryResource]: """Create or update container registry resource. @@ -569,20 +536,9 @@ def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Is either a - ContainerRegistryResource type or a IO type. Required. + ContainerRegistryResource type or a IO[bytes] type. Required. :type container_registry_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ContainerRegistryResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ContainerRegistryResource or IO[bytes] :return: An instance of LROPoller that returns either ContainerRegistryResource or the result of cls(response) :rtype: @@ -618,7 +574,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -630,17 +586,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ContainerRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return LROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -661,22 +615,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -690,11 +643,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -709,14 +658,6 @@ def begin_delete( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_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: @@ -746,7 +687,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -757,24 +698,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _validate_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.ContainerRegistryValidateResult]: error_map = { @@ -802,7 +739,7 @@ def _validate_initial( else: _json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -811,16 +748,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -838,13 +774,9 @@ def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return deserialized # type: ignore @overload def begin_validate( @@ -872,14 +804,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -893,7 +817,7 @@ def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: IO, + container_registry_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -908,18 +832,10 @@ def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Required. - :type container_registry_properties: IO + :type container_registry_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -933,7 +849,7 @@ def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ContainerRegistryValidateResult]: """Check if the container registry properties are valid. @@ -946,20 +862,9 @@ def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Is either a - ContainerRegistryProperties type or a IO type. Required. + ContainerRegistryProperties type or a IO[bytes] type. Required. :type container_registry_properties: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.ContainerRegistryProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.ContainerRegistryProperties or IO[bytes] :return: An instance of LROPoller that returns either ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -995,7 +900,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1007,14 +912,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ContainerRegistryValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return LROPoller[_models.ContainerRegistryValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_custom_domains_operations.py index 078ed9ea5cc..01396b1261e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -871,20 +793,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -982,18 +890,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1004,14 +911,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1021,11 +928,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,7 +943,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_customized_accelerators_operations.py index 846c6aeebf2..e145dfdc8b9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -272,7 +272,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -298,18 +297,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -320,14 +318,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -337,11 +335,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +351,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace def get( self, @@ -377,7 +371,6 @@ def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -398,23 +391,22 @@ def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,13 +418,9 @@ def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -440,7 +428,7 @@ def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -468,7 +456,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -478,16 +466,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -507,10 +494,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -541,14 +524,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -563,7 +538,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +556,10 @@ def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -607,7 +574,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -622,20 +589,9 @@ def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -672,7 +628,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -682,17 +638,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -718,23 +672,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -744,11 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -770,14 +719,6 @@ def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -808,7 +749,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -817,17 +758,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def validate( @@ -858,7 +795,6 @@ def validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -872,7 +808,7 @@ def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -889,11 +825,10 @@ def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -907,7 +842,7 @@ def validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -922,13 +857,9 @@ def validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: CustomizedAcceleratorValidateResult or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomizedAcceleratorValidateResult or None @@ -959,7 +890,7 @@ def validate( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -969,16 +900,15 @@ def validate( content_type=content_type, json=_json, content=_content, - template_url=self.validate.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -992,10 +922,6 @@ def validate( deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_deployments_operations.py index e1219963889..e79817ef125 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -474,7 +474,7 @@ def build_disable_remote_debugging_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_remote_debugging_config_request( +def build_get_remote_debugging_config_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, app_name: str, @@ -708,7 +708,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -729,23 +728,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -757,13 +755,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -771,7 +765,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -799,7 +793,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -809,16 +803,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -841,10 +834,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -874,14 +863,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -896,7 +877,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -913,18 +894,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -939,7 +912,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -954,20 +927,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1004,7 +966,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1014,17 +976,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1045,23 +1005,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1071,11 +1030,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -1092,14 +1047,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1130,7 +1077,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1139,17 +1086,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1157,7 +1100,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1185,7 +1128,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1195,16 +1138,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1224,10 +1166,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1257,14 +1195,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1279,7 +1209,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1296,18 +1226,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1322,7 +1244,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1337,20 +1259,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1387,7 +1298,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1397,17 +1308,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1432,7 +1341,6 @@ def list( :type version: list[str] :param expand: The expand expression to apply on the operation. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentResource] @@ -1457,7 +1365,7 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1465,12 +1373,11 @@ def prepare_request(next_link=None): version=version, expand=expand, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1481,14 +1388,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1498,11 +1405,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1514,10 +1421,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, @@ -1538,7 +1441,6 @@ def list_for_cluster( :type version: list[str] :param expand: The expand expression to apply on the operation. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.DeploymentResource] @@ -1563,19 +1465,18 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, expand=expand, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1586,14 +1487,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1603,11 +1504,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1619,10 +1520,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1642,23 +1539,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1668,11 +1564,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1689,14 +1581,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1727,7 +1611,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1736,17 +1620,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1767,23 +1647,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1793,11 +1672,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1814,14 +1689,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1852,7 +1719,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1861,17 +1728,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1892,23 +1755,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1918,11 +1780,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1939,14 +1797,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1977,7 +1827,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1986,17 +1836,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_remote_debugging_initial( self, @@ -2004,7 +1850,7 @@ def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -2035,7 +1881,7 @@ def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2045,16 +1891,15 @@ def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2074,10 +1919,6 @@ def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload def begin_enable_remote_debugging( self, @@ -2107,14 +1948,6 @@ def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2129,7 +1962,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2146,18 +1979,10 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2172,7 +1997,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> LROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -2187,20 +2012,9 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of LROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -2237,7 +2051,7 @@ def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2247,17 +2061,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2278,23 +2090,22 @@ def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2314,10 +2125,6 @@ def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2333,14 +2140,6 @@ def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -2374,7 +2173,7 @@ def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2384,17 +2183,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def get_remote_debugging_config( @@ -2411,7 +2208,6 @@ def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -2432,23 +2228,22 @@ def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2460,13 +2255,9 @@ def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace def get_log_file_url( @@ -2483,7 +2274,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -2504,23 +2294,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2534,13 +2323,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2548,7 +2333,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2576,7 +2361,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2586,16 +2371,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2605,11 +2389,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2640,14 +2420,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2660,7 +2432,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2677,18 +2449,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2701,7 +2465,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2716,20 +2480,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2763,7 +2516,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2772,17 +2525,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2790,7 +2539,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2818,7 +2567,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2828,16 +2577,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2847,11 +2595,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2882,14 +2626,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2902,7 +2638,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2919,18 +2655,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2943,7 +2671,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2958,20 +2686,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -3005,7 +2722,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3014,17 +2731,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -3032,7 +2745,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -3060,7 +2773,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -3070,16 +2783,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -3089,11 +2801,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -3124,14 +2832,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -3144,7 +2844,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -3161,18 +2861,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -3185,7 +2877,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -3200,20 +2892,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -3247,7 +2928,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3256,14 +2937,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_dev_tool_portals_operations.py index fdba89ae11a..3afa74f6b96 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -198,7 +198,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -224,17 +223,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -245,14 +243,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -262,11 +260,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -278,10 +276,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -295,7 +289,6 @@ def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -316,22 +309,21 @@ def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -343,20 +335,16 @@ def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -526,20 +493,9 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of LROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -616,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_eureka_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_eureka_servers_operations.py index 96a2b8927d8..7b25ead7f6e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_eureka_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_eureka_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -194,7 +194,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResourceCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.EurekaServerResourceCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -215,21 +214,20 @@ def list( ) cls: ClsType[_models.EurekaServerResourceCollection] = kwargs.pop("cls", None) - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -241,13 +239,9 @@ def list( deserialized = self._deserialize("EurekaServerResourceCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers" - } + return deserialized # type: ignore @distributed_trace def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.EurekaServerResource: @@ -258,7 +252,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.EurekaServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -279,21 +272,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -305,19 +297,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -345,7 +333,7 @@ def _update_put_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -353,16 +341,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -385,10 +372,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload def begin_update_put( self, @@ -412,14 +395,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -432,7 +407,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -445,18 +420,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -469,7 +436,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -480,20 +447,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of LROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -528,7 +484,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -540,23 +496,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return LROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -584,7 +538,7 @@ def _update_patch_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -592,16 +546,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -624,10 +577,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload def begin_update_patch( self, @@ -651,14 +600,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -671,7 +612,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -684,18 +625,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -708,7 +641,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -719,20 +652,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of LROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -767,7 +689,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -779,14 +701,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return LROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_gateway_custom_domains_operations.py index 2aa6b18d1a8..e29338d9ba3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_gateway_route_configs_operations.py index fe2d3e191d3..4bff9126085 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload def begin_create_or_update( self, @@ -388,14 +377,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -410,7 +391,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -429,18 +410,10 @@ def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -471,20 +444,9 @@ def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -521,7 +483,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -531,17 +493,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -562,23 +522,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,11 +547,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -609,14 +564,6 @@ def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -647,7 +594,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -656,17 +603,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -681,7 +624,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -707,18 +649,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -729,14 +670,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -746,11 +687,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -761,7 +702,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_gateways_operations.py index 965bbcab8d5..d304e3abcba 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -334,7 +334,6 @@ def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -355,22 +354,21 @@ def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -382,20 +380,16 @@ def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -423,7 +417,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -432,16 +426,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -461,10 +454,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload def begin_create_or_update( self, @@ -490,14 +479,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -511,7 +492,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -526,18 +507,10 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -551,7 +524,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -564,20 +537,9 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -613,7 +575,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -623,24 +585,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_capacity_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> Optional[_models.GatewayResource]: error_map = { @@ -668,7 +628,7 @@ def _update_capacity_initial( else: _json = self._serialize.body(gateway_capacity_resource, "SkuObject") - request = build_update_capacity_request( + _request = build_update_capacity_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -677,16 +637,15 @@ def _update_capacity_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_capacity_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -704,13 +663,9 @@ def _update_capacity_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_capacity_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore @overload def begin_update_capacity( @@ -737,14 +692,6 @@ def begin_update_capacity( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -758,7 +705,7 @@ def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: IO, + gateway_capacity_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -773,18 +720,10 @@ def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Required. - :type gateway_capacity_resource: IO + :type gateway_capacity_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -798,7 +737,7 @@ def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Operation to update an exiting Spring Cloud Gateway capacity. @@ -811,20 +750,9 @@ def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a - SkuObject type or a IO type. Required. + SkuObject type or a IO[bytes] type. Required. :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.SkuObject - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -860,7 +788,7 @@ def begin_update_capacity( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -872,17 +800,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_capacity.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -903,22 +829,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -928,11 +853,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -947,14 +868,6 @@ def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -984,7 +897,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -993,17 +906,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_env_secrets( @@ -1018,7 +927,6 @@ def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -1039,22 +947,21 @@ def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1066,13 +973,9 @@ def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -1093,22 +996,21 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1122,11 +1024,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_restart( @@ -1141,14 +1039,6 @@ def begin_restart( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -1178,7 +1068,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1189,17 +1079,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: @@ -1210,7 +1096,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.GatewayResource] @@ -1235,17 +1120,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1256,14 +1140,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -1273,11 +1157,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1289,10 +1173,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload def validate_domain( self, @@ -1319,7 +1199,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1331,7 +1210,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1346,11 +1225,10 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1362,7 +1240,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -1375,13 +1253,9 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1411,7 +1285,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1420,16 +1294,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1441,10 +1314,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_monitoring_settings_operations.py index 949e90e15b8..213ab64191f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -440,23 +402,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -484,7 +444,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -492,16 +452,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -521,10 +480,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -548,14 +503,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -568,7 +515,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +528,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -605,7 +544,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -616,20 +555,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_11_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -664,7 +592,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -674,14 +602,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_operations.py index 4f646d10324..e8fe70607be 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_predefined_accelerators_operations.py index 36b2dd0ef51..fb4cd729874 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -225,7 +225,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -251,18 +250,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -273,14 +271,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -290,11 +288,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +304,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace def get( self, @@ -330,7 +324,6 @@ def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -351,23 +344,22 @@ def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -379,13 +371,9 @@ def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -411,23 +399,22 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +424,7 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_disable( @@ -463,14 +446,6 @@ def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -501,7 +476,7 @@ def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -510,17 +485,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -546,23 +517,22 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -572,11 +542,7 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_enable( @@ -598,14 +564,6 @@ def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -636,7 +594,7 @@ def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,14 +603,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_runtime_versions_operations.py index 9567752f973..4f4799ece31 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_service_registries_operations.py index 1995e02fb3f..f2036c12ade 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -217,22 +216,21 @@ def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,13 +242,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -271,22 +265,21 @@ def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +299,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -323,14 +312,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -373,17 +354,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -404,22 +383,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,11 +407,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -448,14 +422,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -485,7 +451,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -494,17 +460,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -517,7 +479,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -543,17 +504,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -581,11 +541,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +556,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_services_operations.py index d760ef2b32c..1029587dde8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -598,7 +598,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_supported_server_versions_request( +def build_list_supported_server_versions_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -658,7 +658,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -679,21 +678,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -705,16 +703,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -741,7 +739,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -749,16 +747,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -781,10 +778,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -807,14 +800,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -827,7 +812,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -840,18 +825,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -861,7 +838,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -871,19 +852,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -918,7 +888,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -928,17 +898,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -959,21 +927,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -983,11 +950,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -998,14 +961,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1034,7 +989,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1043,20 +998,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -1083,7 +1038,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1091,16 +1046,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1120,10 +1074,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -1146,14 +1096,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1166,7 +1108,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1179,18 +1121,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1200,7 +1134,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1209,20 +1147,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1257,7 +1184,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1267,17 +1194,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1288,7 +1213,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1309,21 +1233,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1335,13 +1258,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1366,7 +1285,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1377,7 +1295,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1390,11 +1308,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1405,7 +1322,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1416,13 +1333,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_11_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1452,7 +1365,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1460,16 +1373,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1481,13 +1393,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1500,7 +1408,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1521,21 +1428,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1545,11 +1451,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1560,7 +1462,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1581,21 +1482,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1607,13 +1507,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1634,35 +1530,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1673,14 +1564,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1709,7 +1592,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1718,17 +1601,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1749,35 +1628,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1788,14 +1662,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1824,7 +1690,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1833,17 +1699,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1864,21 +1726,20 @@ def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-stat ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_flush_vnet_dns_setting_request( + _request = build_flush_vnet_dns_setting_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._flush_vnet_dns_setting_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1892,11 +1753,7 @@ def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-stat response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _flush_vnet_dns_setting_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_flush_vnet_dns_setting( @@ -1909,14 +1766,6 @@ def begin_flush_vnet_dns_setting( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1945,7 +1794,7 @@ def begin_flush_vnet_dns_setting( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1956,17 +1805,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_flush_vnet_dns_setting.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_supported_apm_types( @@ -1979,7 +1824,6 @@ def list_supported_apm_types( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedApmType or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.SupportedApmType] @@ -2004,17 +1848,16 @@ def list_supported_apm_types( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_apm_types_request( + _request = build_list_supported_apm_types_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_apm_types.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2025,14 +1868,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("SupportedApmTypes", pipeline_response) @@ -2042,11 +1885,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2058,10 +1901,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_supported_apm_types.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes" - } - @distributed_trace def list_globally_enabled_apms( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -2073,7 +1912,6 @@ def list_globally_enabled_apms( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GloballyEnabledApms or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.GloballyEnabledApms :raises ~azure.core.exceptions.HttpResponseError: @@ -2094,21 +1932,20 @@ def list_globally_enabled_apms( ) cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None) - request = build_list_globally_enabled_apms_request( + _request = build_list_globally_enabled_apms_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_globally_enabled_apms.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2120,16 +1957,12 @@ def list_globally_enabled_apms( deserialized = self._deserialize("GloballyEnabledApms", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_globally_enabled_apms.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms" - } + return deserialized # type: ignore def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -2156,7 +1989,7 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme else: _json = self._serialize.body(apm, "ApmReference") - request = build_enable_apm_globally_request( + _request = build_enable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -2164,16 +1997,15 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme content_type=content_type, json=_json, content=_content, - template_url=self._enable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2187,11 +2019,7 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload def begin_enable_apm_globally( @@ -2215,14 +2043,6 @@ def begin_enable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2233,7 +2053,7 @@ def begin_enable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2246,18 +2066,10 @@ def begin_enable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the enable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2265,7 +2077,7 @@ def begin_enable_apm_globally( @distributed_trace def begin_enable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Enable an APM globally. @@ -2274,20 +2086,9 @@ def begin_enable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the enable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the enable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmReference or IO[bytes] :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: @@ -2319,7 +2120,7 @@ def begin_enable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2330,20 +2131,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -2370,7 +2167,7 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(apm, "ApmReference") - request = build_disable_apm_globally_request( + _request = build_disable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -2378,16 +2175,15 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._disable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2401,11 +2197,7 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload def begin_disable_apm_globally( @@ -2429,14 +2221,6 @@ def begin_disable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2447,7 +2231,7 @@ def begin_disable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2460,18 +2244,10 @@ def begin_disable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the disable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2479,7 +2255,7 @@ def begin_disable_apm_globally( @distributed_trace def begin_disable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Disable an APM globally. @@ -2488,20 +2264,9 @@ def begin_disable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the disable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the disable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_11_01_preview.models.ApmReference or IO[bytes] :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: @@ -2533,7 +2298,7 @@ def begin_disable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2544,17 +2309,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -2575,7 +2336,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2583,18 +2343,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2602,20 +2366,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2023_11_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_11_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2645,23 +2408,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2673,19 +2435,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceResource] @@ -2710,15 +2467,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2729,14 +2485,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2746,11 +2502,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2762,8 +2518,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -2771,7 +2525,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.ServiceResource] @@ -2796,16 +2549,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2816,14 +2568,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2833,11 +2585,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2849,10 +2601,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } - @distributed_trace def list_supported_server_versions( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -2864,7 +2612,6 @@ def list_supported_server_versions( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedServerVersion or the result of cls(response) :rtype: @@ -2890,17 +2637,16 @@ def list_supported_server_versions( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_server_versions_request( + _request = build_list_supported_server_versions_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_server_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2911,14 +2657,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("SupportedServerVersions", pipeline_response) @@ -2928,11 +2674,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2943,7 +2689,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list_supported_server_versions.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedServerVersions" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_skus_operations.py index b3fb387e7f6..8eba5994cc8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_storages_operations.py index c4552506f4f..bd05c21c4d3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_11_01_preview/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_11_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -359,14 +348,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -380,7 +361,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -395,18 +376,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -420,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -433,20 +406,9 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2023_11_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -482,7 +444,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -492,17 +454,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -523,22 +483,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +507,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -567,14 +522,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -604,7 +551,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -613,17 +560,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -634,7 +577,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_11_01_preview.models.StorageResource] @@ -659,17 +601,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -680,14 +621,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -697,11 +638,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -712,7 +653,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/_app_platform_management_client.py index c9b666e3ad3..ece445d165f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -156,7 +158,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -237,7 +257,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2023-12-01" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -257,7 +277,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/_configuration.py index 5d85b093073..2bcd7fc34af 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-12-01") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/_app_platform_management_client.py index 54b773d1286..52ec253a9ea 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -159,7 +161,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -240,7 +260,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2023-12-01" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -260,7 +282,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/_configuration.py index 27e19b17393..5fc00426230 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2023-12-01") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_api_portal_custom_domains_operations.py index 695524960fb..0ce91ec8490 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,23 +95,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,13 +122,9 @@ async def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -138,7 +132,7 @@ async def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -237,14 +226,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -259,7 +240,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -277,18 +258,10 @@ async def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -303,7 +276,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -318,20 +291,9 @@ async def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -366,7 +328,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -376,17 +338,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -405,23 +365,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -431,11 +390,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -452,14 +407,6 @@ async def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -488,7 +435,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -497,17 +444,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -522,7 +465,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -546,18 +488,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -568,14 +509,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -585,11 +526,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -600,7 +541,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_api_portals_operations.py index 906505e77cd..98cd57f24ad 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,20 +120,16 @@ async def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -161,7 +155,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -170,16 +164,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -199,10 +192,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload async def begin_create_or_update( self, @@ -228,14 +217,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -249,7 +230,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -264,18 +245,10 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -289,7 +262,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -302,19 +275,9 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. - :type api_portal_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ApiPortalResource type or a IO[bytes] type. Required. + :type api_portal_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -348,7 +311,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -358,17 +321,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -387,22 +348,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -412,11 +372,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -431,14 +387,6 @@ async def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -466,7 +414,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -475,17 +423,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -498,7 +442,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalResource] @@ -521,17 +464,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -542,14 +484,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -559,11 +501,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -575,10 +517,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload async def validate_domain( self, @@ -604,7 +542,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -616,7 +553,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -631,11 +568,10 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -647,7 +583,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -660,13 +596,9 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -694,7 +626,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -703,16 +635,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -724,10 +655,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_apms_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_apms_operations.py index 071f1bc4672..51fad62564b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_apms_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_apms_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -72,7 +72,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApmResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ApmResource] @@ -95,17 +94,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -116,14 +114,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApmResourceCollection", pipeline_response) @@ -133,11 +131,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -149,10 +147,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -166,7 +160,6 @@ async def get( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ApmResource :raises ~azure.core.exceptions.HttpResponseError: @@ -185,22 +178,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -212,20 +204,16 @@ async def get( deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> _models.ApmResource: error_map = { @@ -251,7 +239,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(apm_resource, "ApmResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, @@ -260,16 +248,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -289,10 +276,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } - @overload async def begin_create_or_update( self, @@ -318,14 +301,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -339,7 +314,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: IO, + apm_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -354,18 +329,10 @@ async def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Required. - :type apm_resource: IO + :type apm_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -379,7 +346,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApmResource]: """Create or update an APM. @@ -392,19 +359,8 @@ async def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Is either a ApmResource - type or a IO type. Required. - :type apm_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ApmResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ApmResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApmResource or the result of cls(response) :rtype: @@ -438,7 +394,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -448,17 +404,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApmResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return AsyncLROPoller[_models.ApmResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -477,22 +431,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -506,11 +459,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -525,14 +474,6 @@ async def begin_delete( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_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: @@ -560,7 +501,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -571,17 +512,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_secret_keys( @@ -596,7 +533,6 @@ async def list_secret_keys( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmSecretKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ApmSecretKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -615,22 +551,21 @@ async def list_secret_keys( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None) - request = build_list_secret_keys_request( + _request = build_list_secret_keys_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_secret_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -642,10 +577,6 @@ async def list_secret_keys( deserialized = self._deserialize("ApmSecretKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_secret_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_application_accelerators_operations.py index dbb64b75897..2d63e877131 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -97,17 +96,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -118,14 +116,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -135,11 +133,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -151,10 +149,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -168,7 +162,6 @@ async def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -187,22 +180,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -214,20 +206,16 @@ async def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -253,7 +241,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -262,16 +250,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,10 +278,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -322,14 +305,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -343,7 +318,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -359,18 +334,10 @@ async def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -384,7 +351,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -397,20 +364,9 @@ async def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -444,7 +400,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -454,17 +410,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -483,22 +437,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -512,11 +465,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -531,14 +480,6 @@ async def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -566,7 +507,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -575,14 +516,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_application_live_views_operations.py index 33c6ca08d60..152e0aefea8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -97,17 +96,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -118,14 +116,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -135,11 +133,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -151,10 +149,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -168,7 +162,6 @@ async def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -187,22 +180,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -214,20 +206,16 @@ async def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -253,7 +241,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -262,16 +250,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,10 +278,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload async def begin_create_or_update( self, @@ -321,14 +304,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -342,7 +317,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -357,18 +332,10 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -382,7 +349,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -395,20 +362,9 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -442,7 +398,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -452,17 +408,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -481,22 +435,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -510,11 +463,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -529,14 +478,6 @@ async def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -564,7 +505,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -573,14 +514,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_apps_operations.py index be25f271e6d..8980389f370 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -105,23 +104,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,20 +131,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -172,7 +166,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -181,16 +175,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -213,10 +206,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -278,18 +259,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -303,7 +276,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -316,19 +289,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_12_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_12_01.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -362,7 +324,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -372,17 +334,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -401,22 +361,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,11 +385,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -445,14 +400,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -489,24 +436,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -532,7 +475,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -541,16 +484,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -570,10 +512,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -599,14 +537,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -620,7 +550,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -635,18 +565,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -660,7 +582,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -672,20 +594,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_12_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_12_01.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -719,7 +630,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -729,17 +640,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -750,7 +659,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.AppResource] @@ -773,17 +681,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -794,14 +701,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -811,11 +718,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -827,10 +734,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -844,7 +747,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -863,22 +765,21 @@ async def get_resource_upload_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -890,20 +791,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -929,7 +826,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -938,16 +835,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -967,10 +863,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -997,14 +889,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1018,7 +902,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1033,18 +917,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1058,7 +934,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1071,20 +947,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2023_12_01.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1118,7 +983,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1128,17 +993,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1165,7 +1028,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1177,7 +1039,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1192,11 +1054,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1208,7 +1069,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1221,13 +1082,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1255,7 +1112,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1264,16 +1121,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1285,10 +1141,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_bindings_operations.py index 65825e97f3d..172c59e5125 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,23 +96,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,13 +123,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -139,7 +133,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -239,14 +228,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -261,7 +242,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -278,18 +259,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -304,7 +277,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -319,19 +292,8 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2023_12_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + BindingResource type or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2023_12_01.models.BindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -366,7 +328,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -376,17 +338,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -405,23 +365,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -431,11 +390,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -452,14 +407,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -488,7 +435,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -497,17 +444,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -515,7 +458,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -541,7 +484,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -551,16 +494,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,10 +522,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -612,14 +550,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -634,7 +564,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -651,18 +581,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -677,7 +599,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -692,19 +614,8 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2023_12_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2023_12_01.models.BindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -739,7 +650,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -749,17 +660,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -774,7 +683,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.BindingResource] @@ -797,18 +705,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -819,14 +726,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -836,11 +743,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -851,7 +758,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_build_service_agent_pool_operations.py index 818ce3d0975..62154ee0503 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -98,18 +97,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -172,7 +166,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,23 +184,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -219,13 +211,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -233,7 +221,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -259,7 +247,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -269,16 +257,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -298,10 +285,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -331,14 +314,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -353,7 +328,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -370,18 +345,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -396,7 +363,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -411,20 +378,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -459,7 +415,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -469,14 +425,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_build_service_builder_operations.py index 0a672f16e43..10d62c6e1c9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,23 +96,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,13 +123,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -139,7 +133,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -204,10 +197,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -236,14 +225,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -258,7 +239,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -275,18 +256,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -301,7 +274,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -316,19 +289,8 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. - :type builder_resource: ~azure.mgmt.appplatform.v2023_12_01.models.BuilderResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + BuilderResource type or a IO[bytes] type. Required. + :type builder_resource: ~azure.mgmt.appplatform.v2023_12_01.models.BuilderResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -363,7 +325,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -373,17 +335,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -402,23 +362,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,11 +387,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -449,14 +404,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -485,7 +432,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -494,17 +441,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -519,7 +462,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.BuilderResource] @@ -542,18 +484,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +505,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -581,11 +522,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -597,10 +538,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace_async async def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -616,7 +553,6 @@ async def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -635,23 +571,22 @@ async def list_deployments( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -663,10 +598,6 @@ async def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_build_service_operations.py index aa0815d3792..b64cfb06e22 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.BuildService] @@ -107,17 +106,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -145,11 +143,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -161,10 +159,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -178,7 +172,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -197,22 +190,21 @@ async def get_build_service( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -224,20 +216,16 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> _models.BuildService: error_map = { @@ -263,7 +251,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(build_service, "BuildService") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -272,16 +260,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -301,10 +288,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } - @overload async def begin_create_or_update( self, @@ -330,14 +313,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -351,7 +326,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: IO, + build_service: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -366,18 +341,10 @@ async def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Required. - :type build_service: IO + :type build_service: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -391,7 +358,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildService]: """Create a build service resource. @@ -404,19 +371,8 @@ async def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Is either a BuildService type or a - IO type. Required. - :type build_service: ~azure.mgmt.appplatform.v2023_12_01.models.BuildService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2023_12_01.models.BuildService or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildService or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -462,17 +418,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildService].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return AsyncLROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_builds( @@ -487,7 +441,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.Build] @@ -510,18 +463,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -532,14 +484,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -549,11 +501,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -565,10 +517,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -584,7 +532,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -603,23 +550,22 @@ async def get_build( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -631,13 +577,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -667,7 +609,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -680,7 +621,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -697,11 +638,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -714,7 +654,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -728,13 +668,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2023_12_01.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2023_12_01.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -762,7 +698,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -772,16 +708,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -801,10 +736,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - async def _delete_build_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> None: @@ -822,23 +753,22 @@ async def _delete_build_initial( # pylint: disable=inconsistent-return-statemen api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_build_request( + _request = build_delete_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_build_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -852,11 +782,7 @@ async def _delete_build_initial( # pylint: disable=inconsistent-return-statemen response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_build_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete_build( @@ -873,14 +799,6 @@ async def begin_delete_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_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: @@ -909,7 +827,7 @@ async def begin_delete_build( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -920,17 +838,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_build_results( @@ -947,7 +861,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.BuildResult] @@ -970,19 +883,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -993,14 +905,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1010,11 +922,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1026,10 +938,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -1053,7 +961,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1072,7 +979,7 @@ async def get_build_result( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1080,16 +987,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1101,13 +1007,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -1132,7 +1034,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1151,7 +1052,7 @@ async def get_build_result_log( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1159,16 +1060,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1180,13 +1080,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -1201,7 +1097,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1220,22 +1115,21 @@ async def get_resource_upload_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1247,13 +1141,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -1268,7 +1158,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1287,22 +1176,21 @@ async def list_supported_buildpacks( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1314,13 +1202,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -1337,7 +1221,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1356,23 +1239,22 @@ async def get_supported_buildpack( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1384,13 +1266,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1405,7 +1283,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1424,22 +1301,21 @@ async def list_supported_stacks( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1451,13 +1327,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1474,7 +1346,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1493,23 +1364,22 @@ async def get_supported_stack( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1521,10 +1391,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_buildpack_binding_operations.py index 55a2266957b..b84ae3c065a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -98,17 +97,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -119,14 +117,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -136,11 +134,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -152,10 +150,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace_async async def get( self, @@ -179,7 +173,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -198,7 +191,7 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -206,16 +199,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -227,13 +219,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -242,7 +230,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -268,7 +256,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -279,16 +267,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -308,10 +295,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -344,14 +327,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -367,7 +342,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -387,18 +362,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -414,7 +381,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -431,20 +398,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: ~azure.mgmt.appplatform.v2023_12_01.models.BuildpackBindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -480,7 +436,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -490,17 +446,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -525,7 +479,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -533,16 +487,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -552,11 +505,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -581,14 +530,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -618,7 +559,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -627,17 +568,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -654,7 +591,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -678,19 +614,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -701,14 +636,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -718,11 +653,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -733,7 +668,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_certificates_operations.py index 636b4f385e0..d9aaf92da81 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -94,22 +93,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,20 +119,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -160,7 +154,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -169,16 +163,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -201,10 +194,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -230,14 +219,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -251,7 +232,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -266,18 +247,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -291,7 +264,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -304,20 +277,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CertificateResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -351,7 +313,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -361,17 +323,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -390,22 +350,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -415,11 +374,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -434,14 +389,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -469,7 +416,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -478,17 +425,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -501,7 +444,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.CertificateResource] @@ -524,17 +466,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -545,14 +486,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -562,11 +503,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -577,7 +518,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_config_servers_operations.py index 99e5747e903..c9df98e762e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -87,21 +86,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -113,19 +111,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -151,7 +145,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -159,16 +153,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -188,10 +181,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -214,14 +203,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -234,7 +215,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -247,18 +228,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -271,7 +244,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -282,20 +255,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -328,7 +290,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -338,23 +300,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -380,7 +340,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -388,16 +348,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -417,10 +376,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -443,14 +398,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -463,7 +410,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -476,18 +423,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -500,7 +439,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -511,20 +450,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -557,7 +485,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -567,23 +495,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -609,7 +535,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -617,16 +543,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -646,10 +571,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -672,14 +593,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -692,7 +605,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -705,18 +618,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -729,7 +634,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -740,20 +645,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -786,7 +680,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -798,14 +692,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_configuration_services_operations.py index 9643a987af3..a96e7211cfa 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -162,7 +156,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -171,16 +165,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -200,10 +193,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -231,14 +220,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -252,7 +233,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -307,20 +280,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -354,7 +316,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -364,17 +326,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -393,22 +353,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -418,11 +377,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -437,14 +392,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -472,7 +419,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -481,17 +428,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -504,7 +447,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -528,17 +470,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -549,14 +490,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -566,11 +507,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,16 +523,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -617,7 +554,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -626,16 +563,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -655,10 +591,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -684,14 +616,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -705,7 +629,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -720,18 +644,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -745,7 +661,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -758,19 +674,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. - :type settings: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigurationServiceSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ConfigurationServiceSettings type or a IO[bytes] type. Required. + :type settings: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigurationServiceSettings or + IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -804,7 +710,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -816,24 +722,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_resource_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> Optional[_models.ConfigurationServiceSettingsValidateResult]: error_map = { @@ -859,7 +763,7 @@ async def _validate_resource_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_validate_resource_request( + _request = build_validate_resource_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -868,16 +772,15 @@ async def _validate_resource_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_resource_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -895,13 +798,9 @@ async def _validate_resource_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _validate_resource_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return deserialized # type: ignore @overload async def begin_validate_resource( @@ -930,14 +829,6 @@ async def begin_validate_resource( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -951,7 +842,7 @@ async def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -967,18 +858,10 @@ async def begin_validate_resource( :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be validated. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -992,7 +875,7 @@ async def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service resource is valid. @@ -1005,20 +888,9 @@ async def begin_validate_resource( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be - validated. Is either a ConfigurationServiceResource type or a IO type. Required. + validated. Is either a ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1052,7 +924,7 @@ async def begin_validate_resource( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1064,14 +936,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_resource.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_container_registries_operations.py index b47e3ebe537..168012305dd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_container_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_container_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContainerRegistryResource or the result of cls(response) :rtype: @@ -98,17 +97,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -119,14 +117,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) @@ -136,11 +134,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -152,10 +150,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -169,7 +163,6 @@ async def get( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ContainerRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -188,22 +181,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -215,20 +207,16 @@ async def get( deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> _models.ContainerRegistryResource: error_map = { @@ -254,7 +242,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -263,16 +251,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -292,10 +279,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } - @overload async def begin_create_or_update( self, @@ -322,14 +305,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -343,7 +318,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: IO, + container_registry_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -358,18 +333,10 @@ async def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Required. - :type container_registry_resource: IO + :type container_registry_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -383,7 +350,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ContainerRegistryResource]: """Create or update container registry resource. @@ -396,20 +363,9 @@ async def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Is either a - ContainerRegistryResource type or a IO type. Required. + ContainerRegistryResource type or a IO[bytes] type. Required. :type container_registry_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the result of cls(response) :rtype: @@ -443,7 +399,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -455,17 +411,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ContainerRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return AsyncLROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -484,22 +438,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -513,11 +466,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -532,14 +481,6 @@ async def begin_delete( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_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: @@ -567,7 +508,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -578,24 +519,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _validate_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.ContainerRegistryValidateResult]: error_map = { @@ -621,7 +558,7 @@ async def _validate_initial( else: _json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -630,16 +567,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -657,13 +593,9 @@ async def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return deserialized # type: ignore @overload async def begin_validate( @@ -691,14 +623,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -712,7 +636,7 @@ async def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: IO, + container_registry_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -727,18 +651,10 @@ async def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Required. - :type container_registry_properties: IO + :type container_registry_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -752,7 +668,7 @@ async def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]: """Check if the container registry properties are valid. @@ -765,20 +681,9 @@ async def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Is either a - ContainerRegistryProperties type or a IO type. Required. + ContainerRegistryProperties type or a IO[bytes] type. Required. :type container_registry_properties: - ~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryProperties or IO[bytes] :return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -812,7 +717,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -824,14 +729,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ContainerRegistryValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return AsyncLROPoller[_models.ContainerRegistryValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_custom_domains_operations.py index 1042f408c90..524953ff803 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,23 +96,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,13 +123,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -139,7 +133,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -239,14 +228,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -261,7 +242,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -278,18 +259,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -304,7 +277,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -319,19 +292,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -366,7 +329,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -376,17 +339,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -405,23 +366,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -431,11 +391,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -452,14 +408,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -488,7 +436,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -497,17 +445,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -515,7 +459,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -541,7 +485,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -551,16 +495,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,10 +523,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -612,14 +551,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -634,7 +565,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -651,18 +582,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -677,7 +600,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -692,19 +615,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -739,7 +652,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -749,17 +662,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -774,7 +685,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -798,18 +708,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -820,14 +729,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -837,11 +746,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -852,7 +761,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_customized_accelerators_operations.py index e6c66099465..5a35031a1bd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace_async async def get( self, @@ -179,7 +173,6 @@ async def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -198,23 +191,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -226,13 +218,9 @@ async def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -240,7 +228,7 @@ async def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -266,7 +254,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -276,16 +264,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -305,10 +292,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -339,14 +322,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -361,7 +336,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -379,18 +354,10 @@ async def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -405,7 +372,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -420,20 +387,9 @@ async def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -468,7 +424,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -478,17 +434,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -512,23 +466,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -542,11 +495,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -568,14 +517,6 @@ async def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -604,7 +545,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -613,17 +554,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _validate_initial( self, @@ -631,7 +568,7 @@ async def _validate_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: error_map = { @@ -657,7 +594,7 @@ async def _validate_initial( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -667,16 +604,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -694,13 +630,9 @@ async def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore @overload async def begin_validate( @@ -730,14 +662,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorValidateResult or the result of cls(response) :rtype: @@ -752,7 +676,7 @@ async def begin_validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -769,18 +693,10 @@ async def begin_validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorValidateResult or the result of cls(response) :rtype: @@ -795,7 +711,7 @@ async def begin_validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -810,20 +726,9 @@ async def begin_validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: ~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorProperties or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorValidateResult or the result of cls(response) :rtype: @@ -858,7 +763,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -868,14 +773,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomizedAcceleratorValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return AsyncLROPoller[_models.CustomizedAcceleratorValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_deployments_operations.py index e0e0fd0720c..f875e0b7cb0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -89,7 +89,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -108,23 +107,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -136,13 +134,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -150,7 +144,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -176,7 +170,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -186,16 +180,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,10 +211,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -250,14 +239,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -272,7 +253,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -289,18 +270,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -315,7 +288,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -330,19 +303,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + DeploymentResource type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -377,7 +340,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -387,17 +350,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -416,23 +377,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +402,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +419,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -499,7 +447,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +456,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +470,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -552,7 +496,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -562,16 +506,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -591,10 +534,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -623,14 +562,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -645,7 +576,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -662,18 +593,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -688,7 +611,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -703,19 +626,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource or + IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -750,7 +663,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -760,17 +673,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -792,7 +703,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource] @@ -815,19 +725,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -838,14 +747,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -855,11 +764,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -871,10 +780,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, @@ -895,7 +800,6 @@ def list_for_cluster( :type version: list[str] :param expand: The expand expression to apply on the operation. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource] @@ -918,19 +822,18 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, expand=expand, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -941,14 +844,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -958,11 +861,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -974,10 +877,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -995,23 +894,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1021,11 +919,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1042,14 +936,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1078,7 +964,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1087,17 +973,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1116,23 +998,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1142,11 +1023,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1163,14 +1040,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1199,7 +1068,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1208,17 +1077,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1237,23 +1102,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1263,11 +1127,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1284,14 +1144,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1320,7 +1172,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1329,17 +1181,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_remote_debugging_initial( self, @@ -1347,7 +1195,7 @@ async def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -1376,7 +1224,7 @@ async def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1386,16 +1234,15 @@ async def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1415,10 +1262,6 @@ async def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload async def begin_enable_remote_debugging( self, @@ -1448,14 +1291,6 @@ async def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1470,7 +1305,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1487,18 +1322,10 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1513,7 +1340,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> AsyncLROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -1528,20 +1355,9 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -1576,7 +1392,7 @@ async def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1586,17 +1402,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1615,23 +1429,22 @@ async def _disable_remote_debugging_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1651,10 +1464,6 @@ async def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace_async async def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1670,14 +1479,6 @@ async def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -1709,7 +1510,7 @@ async def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1719,17 +1520,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def get_remote_debugging_config( @@ -1746,7 +1545,6 @@ async def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -1765,23 +1563,22 @@ async def get_remote_debugging_config( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1793,13 +1590,9 @@ async def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1816,7 +1609,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1835,23 +1627,22 @@ async def get_log_file_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1865,13 +1656,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1879,7 +1666,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1905,7 +1692,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1915,16 +1702,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1934,11 +1720,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -1968,14 +1750,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1988,7 +1762,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2005,18 +1779,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2029,7 +1795,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -2044,20 +1810,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -2089,7 +1844,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2098,17 +1853,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2116,7 +1867,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2142,7 +1893,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2152,16 +1903,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2171,11 +1921,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -2205,14 +1951,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2225,7 +1963,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2242,18 +1980,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2266,7 +1996,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -2281,20 +2011,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -2326,7 +2045,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2335,17 +2054,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2353,7 +2068,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2379,7 +2094,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2389,16 +2104,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2408,11 +2122,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2442,14 +2152,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2462,7 +2164,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2479,18 +2181,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2503,7 +2197,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2518,20 +2212,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -2563,7 +2246,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2572,14 +2255,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_dev_tool_portals_operations.py index 53535cdfc3d..d08e59e9115 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -97,17 +96,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -118,14 +116,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -135,11 +133,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -151,10 +149,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/devToolPortals" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -168,7 +162,6 @@ async def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -187,22 +180,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -214,20 +206,16 @@ async def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -253,7 +241,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -262,16 +250,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,10 +278,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload async def begin_create_or_update( self, @@ -321,14 +304,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -342,7 +317,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -357,18 +332,10 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -382,7 +349,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -395,20 +362,9 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -442,7 +398,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -452,17 +408,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -481,22 +435,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -510,11 +463,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -529,14 +478,6 @@ async def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -564,7 +505,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -573,14 +514,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateway_custom_domains_operations.py index baeb3031220..d5c75098a29 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,23 +95,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,13 +122,9 @@ async def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -138,7 +132,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -237,14 +226,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -259,7 +240,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -277,18 +258,10 @@ async def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -303,7 +276,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -318,20 +291,9 @@ async def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -366,7 +328,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -376,17 +338,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -405,23 +365,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -431,11 +390,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -452,14 +407,6 @@ async def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -488,7 +435,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -497,17 +444,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -522,7 +465,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -546,18 +488,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -568,14 +509,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -585,11 +526,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -600,7 +541,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateway_route_configs_operations.py index 042a4d8e22f..0f71c9e3e6b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,23 +95,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,13 +122,9 @@ async def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -138,7 +132,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload async def begin_create_or_update( self, @@ -238,14 +227,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -260,7 +241,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -279,18 +260,10 @@ async def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -305,7 +278,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -321,20 +294,9 @@ async def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -369,7 +331,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -379,17 +341,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -408,23 +368,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,11 +393,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -455,14 +410,6 @@ async def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -491,7 +438,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -500,17 +447,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -525,7 +468,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -549,18 +491,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -571,14 +512,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -588,11 +529,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -603,7 +544,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateways_operations.py index 3a5798535c4..f1b1eb0551e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -163,7 +157,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -172,16 +166,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -201,10 +194,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload async def begin_create_or_update( self, @@ -230,14 +219,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -251,7 +232,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -266,18 +247,10 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -291,7 +264,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -304,19 +277,8 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. - :type gateway_resource: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + GatewayResource type or a IO[bytes] type. Required. + :type gateway_resource: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -350,7 +312,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -360,17 +322,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -389,22 +349,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -414,11 +373,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -433,14 +388,6 @@ async def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -468,7 +415,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -477,17 +424,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_env_secrets( @@ -502,7 +445,6 @@ async def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -521,22 +463,21 @@ async def list_env_secrets( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,13 +489,9 @@ async def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -573,22 +510,21 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -602,11 +538,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_restart( @@ -621,14 +553,6 @@ async def begin_restart( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -656,7 +580,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -667,17 +591,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -690,7 +610,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource] @@ -713,17 +632,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -734,14 +652,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -751,11 +669,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -767,10 +685,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload async def validate_domain( self, @@ -796,7 +710,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -808,7 +721,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -823,11 +736,10 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -839,7 +751,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -852,13 +764,9 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -886,7 +794,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -895,16 +803,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -916,10 +823,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_monitoring_settings_operations.py index 4cc4a2655ff..dd2140478ee 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -88,21 +87,20 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -114,19 +112,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -152,7 +146,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -160,16 +154,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -189,10 +182,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -216,14 +205,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -236,7 +217,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -249,18 +230,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -273,7 +246,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -284,20 +257,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -330,7 +292,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -340,23 +302,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -382,7 +342,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -390,16 +350,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -419,10 +378,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -446,14 +401,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -466,7 +413,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -479,18 +426,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -503,7 +442,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -514,20 +453,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -560,7 +488,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -570,14 +498,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_operations.py index 87e4d31ac1b..07ae982a9b4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.OperationDetail] @@ -80,14 +79,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -98,14 +96,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -115,11 +113,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -130,5 +128,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_predefined_accelerators_operations.py index 078c548bda9..4aeed1e9d2e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -98,18 +97,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace_async async def get( self, @@ -177,7 +171,6 @@ async def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -196,23 +189,22 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -224,13 +216,9 @@ async def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore async def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -254,23 +242,22 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -284,11 +271,7 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_disable( @@ -310,14 +293,6 @@ async def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -346,7 +321,7 @@ async def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -355,17 +330,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -389,23 +360,22 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -419,11 +389,7 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_enable( @@ -445,14 +411,6 @@ async def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -481,7 +439,7 @@ async def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -490,14 +448,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_runtime_versions_operations.py index eaeed759465..464a5712a75 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -74,18 +73,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -97,8 +95,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_service_registries_operations.py index 20021f35c2d..c731c2522e4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -93,22 +92,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -120,13 +118,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -145,22 +139,21 @@ async def _create_or_update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -180,10 +173,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -197,14 +186,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -235,7 +216,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -245,17 +226,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -274,22 +253,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -299,11 +277,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -318,14 +292,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -353,7 +319,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -362,17 +328,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -385,7 +347,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -409,17 +370,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -430,14 +390,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -447,11 +407,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -462,7 +422,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_services_operations.py index 7dacd3376ab..870afb098b9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -105,21 +104,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -131,16 +129,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -165,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -173,16 +171,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +202,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -231,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -251,7 +236,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -264,18 +249,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -285,7 +262,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -295,19 +276,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -340,7 +310,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -350,17 +320,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -379,21 +347,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -403,11 +370,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -418,14 +381,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -452,7 +407,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -461,20 +416,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -499,7 +454,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -507,16 +462,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -536,10 +490,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -562,14 +512,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -582,7 +524,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -595,18 +537,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -616,7 +550,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -625,20 +563,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -671,7 +598,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -681,17 +608,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -702,7 +627,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -721,21 +645,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -747,13 +670,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -778,7 +697,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -789,7 +707,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -802,11 +720,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -817,7 +734,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -828,13 +745,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2023_12_01.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_12_01.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -862,7 +775,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -870,16 +783,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -891,13 +803,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -910,7 +818,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -929,21 +836,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -953,11 +859,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -970,7 +872,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -989,21 +890,20 @@ async def enable_test_endpoint( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1015,13 +915,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1040,35 +936,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1079,14 +970,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1113,7 +996,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1122,17 +1005,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1151,35 +1030,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1190,14 +1064,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1224,7 +1090,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1233,17 +1099,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1262,21 +1124,20 @@ async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-retur api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_flush_vnet_dns_setting_request( + _request = build_flush_vnet_dns_setting_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._flush_vnet_dns_setting_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1289,11 +1150,7 @@ async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-retur response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _flush_vnet_dns_setting_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_flush_vnet_dns_setting( @@ -1306,14 +1163,6 @@ async def begin_flush_vnet_dns_setting( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1340,7 +1189,7 @@ async def begin_flush_vnet_dns_setting( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1351,17 +1200,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_flush_vnet_dns_setting.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_supported_apm_types( @@ -1374,7 +1219,6 @@ def list_supported_apm_types( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedApmType or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.SupportedApmType] @@ -1397,17 +1241,16 @@ def list_supported_apm_types( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_apm_types_request( + _request = build_list_supported_apm_types_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_apm_types.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1418,14 +1261,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("SupportedApmTypes", pipeline_response) @@ -1435,11 +1278,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1451,10 +1294,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_supported_apm_types.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes" - } - @distributed_trace_async async def list_globally_enabled_apms( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1466,7 +1305,6 @@ async def list_globally_enabled_apms( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GloballyEnabledApms or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GloballyEnabledApms :raises ~azure.core.exceptions.HttpResponseError: @@ -1485,21 +1323,20 @@ async def list_globally_enabled_apms( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None) - request = build_list_globally_enabled_apms_request( + _request = build_list_globally_enabled_apms_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_globally_enabled_apms.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1511,16 +1348,12 @@ async def list_globally_enabled_apms( deserialized = self._deserialize("GloballyEnabledApms", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_globally_enabled_apms.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms" - } + return deserialized # type: ignore async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1545,7 +1378,7 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s else: _json = self._serialize.body(apm, "ApmReference") - request = build_enable_apm_globally_request( + _request = build_enable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1553,16 +1386,15 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s content_type=content_type, json=_json, content=_content, - template_url=self._enable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,11 +1408,7 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload async def begin_enable_apm_globally( @@ -1604,14 +1432,6 @@ async def begin_enable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1622,7 +1442,7 @@ async def begin_enable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1635,18 +1455,10 @@ async def begin_enable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the enable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1654,7 +1466,7 @@ async def begin_enable_apm_globally( @distributed_trace_async async def begin_enable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Enable an APM globally. @@ -1663,20 +1475,9 @@ async def begin_enable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the enable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the enable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO[bytes] :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: @@ -1706,7 +1507,7 @@ async def begin_enable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1718,20 +1519,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1756,7 +1553,7 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(apm, "ApmReference") - request = build_disable_apm_globally_request( + _request = build_disable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1764,16 +1561,15 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._disable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1787,11 +1583,7 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload async def begin_disable_apm_globally( @@ -1815,14 +1607,6 @@ async def begin_disable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1833,7 +1617,7 @@ async def begin_disable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1846,18 +1630,10 @@ async def begin_disable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the disable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1865,7 +1641,7 @@ async def begin_disable_apm_globally( @distributed_trace_async async def begin_disable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Disable an APM globally. @@ -1874,20 +1650,9 @@ async def begin_disable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the disable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the disable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO[bytes] :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: @@ -1917,7 +1682,7 @@ async def begin_disable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1929,17 +1694,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -1960,7 +1721,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1968,18 +1728,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -1987,20 +1751,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2028,23 +1791,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2056,19 +1818,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource] @@ -2091,15 +1848,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2110,14 +1866,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2127,11 +1883,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2143,8 +1899,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -2152,7 +1906,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource] @@ -2175,16 +1928,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2195,14 +1947,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2212,11 +1964,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2228,10 +1980,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } - @distributed_trace def list_supported_server_versions( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -2243,7 +1991,6 @@ def list_supported_server_versions( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedServerVersion or the result of cls(response) :rtype: @@ -2267,17 +2014,16 @@ def list_supported_server_versions( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_server_versions_request( + _request = build_list_supported_server_versions_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_server_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2288,14 +2034,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("SupportedServerVersions", pipeline_response) @@ -2305,11 +2051,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2320,7 +2066,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list_supported_server_versions.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedServerVersions" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_skus_operations.py index 7257d240285..00db1d4988a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ResourceSku] @@ -80,15 +79,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -99,14 +97,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -116,11 +114,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -131,5 +129,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_storages_operations.py index 51ce609bd02..c5e4f09019b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -94,22 +93,21 @@ async def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,20 +119,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -160,7 +154,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -169,16 +163,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -201,10 +194,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -230,14 +219,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -251,7 +232,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -266,18 +247,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -291,7 +264,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -304,19 +277,8 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. - :type storage_resource: ~azure.mgmt.appplatform.v2023_12_01.models.StorageResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + StorageResource type or a IO[bytes] type. Required. + :type storage_resource: ~azure.mgmt.appplatform.v2023_12_01.models.StorageResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -350,7 +312,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -360,17 +322,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -389,22 +349,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -414,11 +373,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -433,14 +388,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -468,7 +415,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -477,17 +424,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -500,7 +443,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.StorageResource] @@ -523,17 +465,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -544,14 +485,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -561,11 +502,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -576,7 +517,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py index 8bf38727bf8..18d3a3b2e3a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py @@ -30,7 +30,7 @@ class AcceleratorAuthSetting(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AcceleratorBasicAuthSetting, AcceleratorPublicSetting, AcceleratorSshSetting - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -61,7 +61,7 @@ def __init__(self, **kwargs: Any) -> None: class AcceleratorBasicAuthSetting(AcceleratorAuthSetting): """Auth setting for basic auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -106,7 +106,7 @@ def __init__( class AcceleratorGitRepository(_serialization.Model): """AcceleratorGitRepository. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: Git repository URL for the accelerator. Required. :vartype url: str @@ -182,7 +182,7 @@ def __init__( class AcceleratorPublicSetting(AcceleratorAuthSetting): """Auth setting for public url. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -212,7 +212,7 @@ def __init__(self, *, ca_cert_resource_id: Optional[str] = None, **kwargs: Any) class AcceleratorSshSetting(AcceleratorAuthSetting): """Auth setting for SSH auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -352,24 +352,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class ApiPortalCustomDomainResource(ProxyResource): """Custom domain of the API portal. @@ -695,7 +677,7 @@ class ApmProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: APM Type. Required. :vartype type: str @@ -747,7 +729,7 @@ def __init__( class ApmReference(_serialization.Model): """A reference to the APM. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of the APM. Required. :vartype resource_id: str @@ -1613,7 +1595,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -1675,7 +1657,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -2551,7 +2533,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2589,7 +2571,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2971,7 +2953,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3043,7 +3025,7 @@ def __init__(self, **kwargs: Any) -> None: class CertificateReference(_serialization.Model): """A reference to the certificate. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of the certificate. Required. :vartype resource_id: str @@ -3273,7 +3255,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: list[~azure.mgmt.appplatform.v2023_12_01.models.GitPatternRepository] @@ -3566,7 +3548,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -3603,7 +3585,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -3944,7 +3926,7 @@ def __init__( self.git_property = git_property -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -4000,7 +3982,7 @@ class ContainerRegistryCredentials(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ContainerRegistryBasicCredentials - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The credential type of the container registry credentials. Required. :vartype type: str @@ -4025,7 +4007,7 @@ def __init__(self, **kwargs: Any) -> None: class ContainerRegistryBasicCredentials(ContainerRegistryCredentials): """The basic authentication properties for the container registry resource. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The credential type of the container registry credentials. Required. :vartype type: str @@ -4072,7 +4054,7 @@ class ContainerRegistryProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar credentials: The credentials of the container registry resource. Required. :vartype credentials: ~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryCredentials @@ -4206,7 +4188,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -4340,7 +4322,7 @@ def __init__( class CustomContainerUserSourceInfo(UserSourceInfo): """Custom container user source info. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4497,7 +4479,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -4551,7 +4533,7 @@ class CustomizedAcceleratorProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar provisioning_state: State of the customized accelerator. Known values are: "Creating", "Updating", "Succeeded", "Failed", "Deleting", and "Canceled". @@ -4756,7 +4738,7 @@ def __init__( class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -5553,7 +5535,7 @@ class ProbeAction(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ExecAction, HTTPGetAction, TCPSocketAction - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -5581,7 +5563,7 @@ def __init__(self, **kwargs: Any) -> None: class ExecAction(ProbeAction): """ExecAction describes a "run in container" action. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -6520,7 +6502,7 @@ def __init__( class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -6642,7 +6624,7 @@ def __init__(self, *, value: Optional[List[str]] = None, **kwargs: Any) -> None: class HTTPGetAction(ProbeAction): """HTTPGetAction describes an action based on HTTP Get requests. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -6833,7 +6815,7 @@ class UploadedUserSourceInfo(UserSourceInfo): JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo, WarUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -6877,7 +6859,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -6933,7 +6915,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -7038,7 +7020,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -7072,7 +7054,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -7524,7 +7506,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -7557,7 +7539,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -8035,7 +8017,7 @@ class Probe(_serialization.Model): """Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive traffic. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar probe_action: The action of the probe. :vartype probe_action: ~azure.mgmt.appplatform.v2023_12_01.models.ProbeAction @@ -8117,7 +8099,7 @@ def __init__( class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2023_12_01.models.TestKeyType @@ -8998,7 +8980,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -9072,7 +9054,7 @@ def __init__(self, *, sku: Optional["_models.Sku"] = None, **kwargs: Any) -> Non class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -9213,7 +9195,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2023_12_01.models.StorageType @@ -9238,7 +9220,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2023_12_01.models.StorageType @@ -9782,7 +9764,7 @@ def __init__( class TCPSocketAction(ProbeAction): """TCPSocketAction describes an action based on opening a socket. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -10008,7 +9990,7 @@ def __init__(self, *, name: Optional[str] = None, messages: Optional[List[str]] class WarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded War binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_api_portal_custom_domains_operations.py index 78688c06799..67de1de614d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -242,23 +241,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -270,13 +268,9 @@ def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -284,7 +278,7 @@ def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -310,7 +304,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -320,16 +314,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,10 +342,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -383,14 +372,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -405,7 +386,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -423,18 +404,10 @@ def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -449,7 +422,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -464,20 +437,9 @@ def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -512,7 +474,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -522,17 +484,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -551,23 +511,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -577,11 +536,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -598,14 +553,6 @@ def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -634,7 +581,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -643,17 +590,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -668,7 +611,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -692,18 +634,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -714,14 +655,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -731,11 +672,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,7 +687,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_api_portals_operations.py index c7e24eb814b..250c6913e77 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -254,22 +253,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -281,20 +279,16 @@ def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -320,7 +314,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -329,16 +323,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -358,10 +351,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -408,7 +389,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -423,18 +404,10 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -448,7 +421,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -461,19 +434,9 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. - :type api_portal_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ApiPortalResource type or a IO[bytes] type. Required. + :type api_portal_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalResource or + IO[bytes] :return: An instance of LROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -507,7 +470,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -517,17 +480,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -546,22 +507,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -571,11 +531,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -590,14 +546,6 @@ def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -625,7 +573,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -634,17 +582,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: @@ -655,7 +599,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalResource] @@ -678,17 +621,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -699,14 +641,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -716,11 +658,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -732,10 +674,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload def validate_domain( self, @@ -761,7 +699,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -773,7 +710,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -788,11 +725,10 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -804,7 +740,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -817,13 +753,9 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -851,7 +783,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -860,16 +792,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -881,10 +812,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_apms_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_apms_operations.py index 2ef03006fe4..ab1fd0a9538 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_apms_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_apms_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -228,7 +228,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApmResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ApmResource] :raises ~azure.core.exceptions.HttpResponseError: @@ -250,17 +249,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -271,14 +269,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApmResourceCollection", pipeline_response) @@ -288,11 +286,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -304,10 +302,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms" - } - @distributed_trace def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any) -> _models.ApmResource: """Get the APM by name. @@ -319,7 +313,6 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ApmResource :raises ~azure.core.exceptions.HttpResponseError: @@ -338,22 +331,21 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -365,20 +357,16 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> _models.ApmResource: error_map = { @@ -404,7 +392,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(apm_resource, "ApmResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, @@ -413,16 +401,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,10 +429,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } - @overload def begin_create_or_update( self, @@ -471,14 +454,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ApmResource] @@ -491,7 +466,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: IO, + apm_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -506,18 +481,10 @@ def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Required. - :type apm_resource: IO + :type apm_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ApmResource] @@ -530,7 +497,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApmResource]: """Create or update an APM. @@ -543,19 +510,8 @@ def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Is either a ApmResource - type or a IO type. Required. - :type apm_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ApmResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ApmResource or IO[bytes] :return: An instance of LROPoller that returns either ApmResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ApmResource] @@ -588,7 +544,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -598,17 +554,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApmResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return LROPoller[_models.ApmResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -627,22 +581,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -656,11 +609,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -675,14 +624,6 @@ def begin_delete( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_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: @@ -710,7 +651,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -721,17 +662,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_secret_keys( @@ -746,7 +683,6 @@ def list_secret_keys( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmSecretKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ApmSecretKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -765,22 +701,21 @@ def list_secret_keys( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None) - request = build_list_secret_keys_request( + _request = build_list_secret_keys_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_secret_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -792,10 +727,6 @@ def list_secret_keys( deserialized = self._deserialize("ApmSecretKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_secret_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_application_accelerators_operations.py index 834ae227357..c0406266a6c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -204,7 +204,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -228,17 +227,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -249,14 +247,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -266,11 +264,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -282,10 +280,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -299,7 +293,6 @@ def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -318,22 +311,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -345,20 +337,16 @@ def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -453,14 +436,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -474,7 +449,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -490,18 +465,10 @@ def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -515,7 +482,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -528,20 +495,9 @@ def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -575,7 +531,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -585,17 +541,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -614,22 +568,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -643,11 +596,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -662,14 +611,6 @@ def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -697,7 +638,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -706,14 +647,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_application_live_views_operations.py index 001e23e964b..7e2f4d17f70 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -204,7 +204,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -228,17 +227,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -249,14 +247,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -266,11 +264,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -282,10 +280,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -299,7 +293,6 @@ def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -318,22 +311,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -345,20 +337,16 @@ def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -526,20 +493,9 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -573,7 +529,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -583,17 +539,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -612,22 +566,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -695,7 +636,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -704,14 +645,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_apps_operations.py index 62973bdc3a2..7c1060ac535 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -371,23 +370,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -399,20 +397,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -438,7 +432,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -447,16 +441,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -479,10 +472,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -508,14 +497,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.AppResource] @@ -528,7 +509,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -543,18 +524,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.AppResource] @@ -567,7 +540,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -580,19 +553,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_12_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_12_01.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.AppResource] @@ -625,7 +587,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -635,17 +597,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -664,22 +624,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -689,11 +648,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -708,14 +663,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -743,7 +690,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -752,24 +699,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -795,7 +738,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -804,16 +747,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -833,10 +775,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -862,14 +800,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.AppResource] @@ -882,7 +812,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -897,18 +827,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.AppResource] @@ -921,7 +843,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -933,20 +855,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2023_12_01.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2023_12_01.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.AppResource] @@ -979,7 +890,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -989,17 +900,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1010,7 +919,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.AppResource] :raises ~azure.core.exceptions.HttpResponseError: @@ -1032,17 +940,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1053,14 +960,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1070,11 +977,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1086,10 +993,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1103,7 +1006,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1122,22 +1024,21 @@ def get_resource_upload_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1149,20 +1050,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1188,7 +1085,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1197,16 +1094,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1226,10 +1122,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1256,14 +1148,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.AppResource] @@ -1276,7 +1160,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1291,18 +1175,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.AppResource] @@ -1315,7 +1191,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1328,20 +1204,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2023_12_01.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.AppResource] @@ -1374,7 +1239,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1384,17 +1249,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1421,7 +1284,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1433,7 +1295,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1448,11 +1310,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1464,7 +1325,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1477,13 +1338,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1511,7 +1368,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1520,16 +1377,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1541,10 +1397,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_bindings_operations.py index 9d511cc795a..f8e87b9a8fe 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -263,23 +262,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,13 +289,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -305,7 +299,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -331,7 +325,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -341,16 +335,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -373,10 +366,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -405,14 +394,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -427,7 +408,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -444,18 +425,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -470,7 +443,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -485,19 +458,8 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2023_12_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + BindingResource type or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2023_12_01.models.BindingResource or IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -532,7 +494,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -542,17 +504,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -571,23 +531,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -597,11 +556,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -618,14 +573,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -654,7 +601,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -663,17 +610,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -681,7 +624,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -707,7 +650,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -717,16 +660,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,10 +688,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -778,14 +716,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -800,7 +730,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -817,18 +747,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -843,7 +765,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -858,19 +780,8 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. - :type binding_resource: ~azure.mgmt.appplatform.v2023_12_01.models.BindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2023_12_01.models.BindingResource or IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -905,7 +816,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -915,17 +826,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -940,7 +849,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.BindingResource] @@ -963,18 +871,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -985,14 +892,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1002,11 +909,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1017,7 +924,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_build_service_agent_pool_operations.py index 0b7a1a609eb..2edad393016 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -207,18 +206,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -229,14 +227,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -246,11 +244,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -262,10 +260,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -281,7 +275,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -300,23 +293,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -328,13 +320,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -342,7 +330,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -368,7 +356,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -378,16 +366,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -407,10 +394,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -440,14 +423,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -462,7 +437,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -479,18 +454,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -505,7 +472,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -520,20 +487,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -568,7 +524,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -578,14 +534,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_build_service_builder_operations.py index fd052cbdc30..614669f4260 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -261,7 +261,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -280,23 +279,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -308,13 +306,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -322,7 +316,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -348,7 +342,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -358,16 +352,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -387,10 +380,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -419,14 +408,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -441,7 +422,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -458,18 +439,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -484,7 +457,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -499,19 +472,8 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. - :type builder_resource: ~azure.mgmt.appplatform.v2023_12_01.models.BuilderResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + BuilderResource type or a IO[bytes] type. Required. + :type builder_resource: ~azure.mgmt.appplatform.v2023_12_01.models.BuilderResource or IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -546,7 +508,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -556,17 +518,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -585,23 +545,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -611,11 +570,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -632,14 +587,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -668,7 +615,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -677,17 +624,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -702,7 +645,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.BuilderResource] @@ -725,18 +667,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -747,14 +688,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -764,11 +705,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -780,10 +721,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -799,7 +736,6 @@ def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -818,23 +754,22 @@ def list_deployments( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -846,10 +781,6 @@ def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_build_service_operations.py index bde89be53f1..44570e02e30 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -607,7 +607,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.BuildService] :raises ~azure.core.exceptions.HttpResponseError: @@ -629,17 +628,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -650,14 +648,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -667,11 +665,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -683,10 +681,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -700,7 +694,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -719,22 +712,21 @@ def get_build_service( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,20 +738,16 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> _models.BuildService: error_map = { @@ -785,7 +773,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(build_service, "BuildService") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -794,16 +782,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -823,10 +810,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } - @overload def begin_create_or_update( self, @@ -852,14 +835,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.BuildService] @@ -872,7 +847,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: IO, + build_service: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -887,18 +862,10 @@ def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Required. - :type build_service: IO + :type build_service: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.BuildService] @@ -911,7 +878,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildService]: """Create a build service resource. @@ -924,19 +891,8 @@ def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Is either a BuildService type or a - IO type. Required. - :type build_service: ~azure.mgmt.appplatform.v2023_12_01.models.BuildService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2023_12_01.models.BuildService or IO[bytes] :return: An instance of LROPoller that returns either BuildService or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.BuildService] @@ -969,7 +925,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -981,17 +937,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildService].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return LROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_builds( @@ -1006,7 +960,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -1028,18 +981,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1050,14 +1002,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -1067,11 +1019,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1083,10 +1035,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1102,7 +1050,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1121,23 +1068,22 @@ def get_build( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1149,13 +1095,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -1185,7 +1127,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1198,7 +1139,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1215,11 +1156,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1232,7 +1172,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -1246,13 +1186,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2023_12_01.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2023_12_01.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1280,7 +1216,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1290,16 +1226,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1319,10 +1254,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - def _delete_build_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> None: @@ -1340,23 +1271,22 @@ def _delete_build_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_build_request( + _request = build_delete_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_build_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1370,11 +1300,7 @@ def _delete_build_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_build_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete_build( @@ -1391,14 +1317,6 @@ def begin_delete_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_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: @@ -1427,7 +1345,7 @@ def begin_delete_build( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1438,17 +1356,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_build_results( @@ -1465,7 +1379,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.BuildResult] :raises ~azure.core.exceptions.HttpResponseError: @@ -1487,19 +1400,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1510,14 +1422,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1527,11 +1439,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1543,10 +1455,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1570,7 +1478,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1589,7 +1496,7 @@ def get_build_result( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1597,16 +1504,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1618,13 +1524,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1649,7 +1551,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1668,7 +1569,7 @@ def get_build_result_log( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1676,16 +1577,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1697,13 +1597,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1718,7 +1614,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1737,22 +1632,21 @@ def get_resource_upload_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1764,13 +1658,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1785,7 +1675,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1804,22 +1693,21 @@ def list_supported_buildpacks( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1831,13 +1719,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1854,7 +1738,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1873,23 +1756,22 @@ def get_supported_buildpack( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1901,13 +1783,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1922,7 +1800,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1941,22 +1818,21 @@ def list_supported_stacks( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1968,13 +1844,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -1991,7 +1863,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -2010,23 +1881,22 @@ def get_supported_stack( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2038,10 +1908,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_buildpack_binding_operations.py index 612c30d5614..8871f4cfcd2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -262,7 +262,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -286,17 +285,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -307,14 +305,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -324,11 +322,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -340,10 +338,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace def get( self, @@ -367,7 +361,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -386,7 +379,7 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -394,16 +387,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -415,13 +407,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -430,7 +418,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -456,7 +444,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -467,16 +455,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -496,10 +483,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -532,14 +515,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -555,7 +530,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -575,18 +550,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -602,7 +569,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -619,20 +586,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: ~azure.mgmt.appplatform.v2023_12_01.models.BuildpackBindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -668,7 +624,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -678,17 +634,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -713,7 +667,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -721,16 +675,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,11 +693,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -769,14 +718,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -806,7 +747,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -815,17 +756,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -842,7 +779,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -866,19 +802,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -889,14 +824,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -906,11 +841,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -921,7 +856,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_certificates_operations.py index 6b03de71107..ab5da8ca528 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -219,22 +218,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -246,20 +244,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -285,7 +279,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -294,16 +288,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -326,10 +319,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -355,14 +344,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -376,7 +357,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -391,18 +372,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -416,7 +389,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -429,20 +402,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CertificateResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -476,7 +438,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -486,17 +448,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -515,22 +475,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -540,11 +499,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -559,14 +514,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -594,7 +541,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -603,17 +550,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -626,7 +569,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.CertificateResource] @@ -649,17 +591,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -670,14 +611,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -687,11 +628,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -702,7 +643,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_config_servers_operations.py index 76a9ccec186..93457a2dc93 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -216,21 +215,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -242,19 +240,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -280,7 +274,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -288,16 +282,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -317,10 +310,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -343,14 +332,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +357,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -400,7 +373,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -411,20 +384,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -457,7 +419,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -467,23 +429,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -509,7 +469,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -517,16 +477,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -546,10 +505,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -572,14 +527,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -592,7 +539,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -605,18 +552,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -629,7 +568,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -640,20 +579,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -686,7 +614,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -696,23 +624,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -738,7 +664,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -746,16 +672,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -775,10 +700,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -801,14 +722,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -821,7 +734,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -834,18 +747,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -858,7 +763,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -869,20 +774,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -915,7 +809,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -927,14 +821,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_configuration_services_operations.py index 7a376ae2025..0312cd16cfd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -280,7 +280,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -299,22 +298,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -326,20 +324,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -365,7 +359,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -374,16 +368,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -403,10 +396,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -434,14 +423,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -455,7 +436,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -471,18 +452,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -496,7 +469,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -510,20 +483,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -557,7 +519,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -567,17 +529,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -596,22 +556,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -621,11 +580,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -640,14 +595,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -675,7 +622,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -684,17 +631,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -707,7 +650,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -731,17 +673,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -752,14 +693,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -769,11 +710,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -785,16 +726,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -820,7 +757,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -829,16 +766,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -858,10 +794,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -887,14 +819,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -908,7 +832,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -923,18 +847,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -948,7 +864,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -961,19 +877,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. - :type settings: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigurationServiceSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ConfigurationServiceSettings type or a IO[bytes] type. Required. + :type settings: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigurationServiceSettings or + IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1007,7 +913,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1019,24 +925,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_resource_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> Optional[_models.ConfigurationServiceSettingsValidateResult]: error_map = { @@ -1062,7 +966,7 @@ def _validate_resource_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_validate_resource_request( + _request = build_validate_resource_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -1071,16 +975,15 @@ def _validate_resource_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_resource_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1098,13 +1001,9 @@ def _validate_resource_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - _validate_resource_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return deserialized # type: ignore @overload def begin_validate_resource( @@ -1133,14 +1032,6 @@ def begin_validate_resource( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1154,7 +1045,7 @@ def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1170,18 +1061,10 @@ def begin_validate_resource( :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be validated. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1195,7 +1078,7 @@ def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service resource is valid. @@ -1208,20 +1091,9 @@ def begin_validate_resource( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be - validated. Is either a ConfigurationServiceResource type or a IO type. Required. + validated. Is either a ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1255,7 +1127,7 @@ def begin_validate_resource( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1267,14 +1139,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_resource.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_container_registries_operations.py index 6af3ea170fe..b84a5b11ff9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_container_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_container_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -241,7 +241,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContainerRegistryResource or the result of cls(response) :rtype: @@ -265,17 +264,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -286,14 +284,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) @@ -303,11 +301,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -319,10 +317,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -336,7 +330,6 @@ def get( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ContainerRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -355,22 +348,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -382,20 +374,16 @@ def get( deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> _models.ContainerRegistryResource: error_map = { @@ -421,7 +409,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -430,16 +418,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -459,10 +446,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } - @overload def begin_create_or_update( self, @@ -489,14 +472,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -510,7 +485,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: IO, + container_registry_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -525,18 +500,10 @@ def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Required. - :type container_registry_resource: IO + :type container_registry_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -550,7 +517,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ContainerRegistryResource]: """Create or update container registry resource. @@ -563,20 +530,9 @@ def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Is either a - ContainerRegistryResource type or a IO type. Required. + ContainerRegistryResource type or a IO[bytes] type. Required. :type container_registry_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource or IO[bytes] :return: An instance of LROPoller that returns either ContainerRegistryResource or the result of cls(response) :rtype: @@ -610,7 +566,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -622,17 +578,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ContainerRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return LROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -651,22 +605,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -680,11 +633,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -699,14 +648,6 @@ def begin_delete( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_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: @@ -734,7 +675,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -745,24 +686,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _validate_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.ContainerRegistryValidateResult]: error_map = { @@ -788,7 +725,7 @@ def _validate_initial( else: _json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -797,16 +734,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -824,13 +760,9 @@ def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return deserialized # type: ignore @overload def begin_validate( @@ -858,14 +790,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -879,7 +803,7 @@ def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: IO, + container_registry_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -894,18 +818,10 @@ def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Required. - :type container_registry_properties: IO + :type container_registry_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -919,7 +835,7 @@ def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ContainerRegistryValidateResult]: """Check if the container registry properties are valid. @@ -932,20 +848,9 @@ def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Is either a - ContainerRegistryProperties type or a IO type. Required. + ContainerRegistryProperties type or a IO[bytes] type. Required. :type container_registry_properties: - ~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryProperties or IO[bytes] :return: An instance of LROPoller that returns either ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -979,7 +884,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -991,14 +896,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ContainerRegistryValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return LROPoller[_models.ContainerRegistryValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_custom_domains_operations.py index c2f78caf7b7..b5651ba7d5a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -263,23 +262,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,13 +289,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -305,7 +299,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -331,7 +325,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -341,16 +335,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -373,10 +366,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -405,14 +394,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -427,7 +408,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -444,18 +425,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -470,7 +443,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -485,19 +458,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource or + IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -532,7 +495,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -542,17 +505,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -571,23 +532,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -597,11 +557,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -618,14 +574,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -654,7 +602,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -663,17 +611,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -681,7 +625,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -707,7 +651,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -717,16 +661,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,10 +689,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -778,14 +717,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -800,7 +731,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -817,18 +748,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -843,7 +766,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -858,19 +781,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. - :type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource or + IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -905,7 +818,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -915,17 +828,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -940,7 +851,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -964,18 +874,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -986,14 +895,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1003,11 +912,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1018,7 +927,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_customized_accelerators_operations.py index e17e0488bce..8bf7a70cbf9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -280,7 +280,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -304,18 +303,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -326,14 +324,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -343,11 +341,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -359,10 +357,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace def get( self, @@ -383,7 +377,6 @@ def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -402,23 +395,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -430,13 +422,9 @@ def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -444,7 +432,7 @@ def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -470,7 +458,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -480,16 +468,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -509,10 +496,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -543,14 +526,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -565,7 +540,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -583,18 +558,10 @@ def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -609,7 +576,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -624,20 +591,9 @@ def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -672,7 +628,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -682,17 +638,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -716,23 +670,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,11 +699,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -772,14 +721,6 @@ def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -808,7 +749,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -817,17 +758,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _validate_initial( self, @@ -835,7 +772,7 @@ def _validate_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: error_map = { @@ -861,7 +798,7 @@ def _validate_initial( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -871,16 +808,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -898,13 +834,9 @@ def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore @overload def begin_validate( @@ -934,14 +866,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorValidateResult or the result of cls(response) :rtype: @@ -956,7 +880,7 @@ def begin_validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -973,18 +897,10 @@ def begin_validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorValidateResult or the result of cls(response) :rtype: @@ -999,7 +915,7 @@ def begin_validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -1014,20 +930,9 @@ def begin_validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: ~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorProperties or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either CustomizedAcceleratorValidateResult or the result of cls(response) :rtype: @@ -1062,7 +967,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1072,14 +977,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomizedAcceleratorValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return LROPoller[_models.CustomizedAcceleratorValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_deployments_operations.py index c271f7c9802..f75ce4f4840 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -471,7 +471,7 @@ def build_disable_remote_debugging_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_remote_debugging_config_request( +def build_get_remote_debugging_config_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, app_name: str, @@ -705,7 +705,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -724,23 +723,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -752,13 +750,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -766,7 +760,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -792,7 +786,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -802,16 +796,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -834,10 +827,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -866,14 +855,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -888,7 +869,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -905,18 +886,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -931,7 +904,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -946,19 +919,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + DeploymentResource type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource or + IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -993,7 +956,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1003,17 +966,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1032,23 +993,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1058,11 +1018,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -1079,14 +1035,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1115,7 +1063,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1124,17 +1072,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1142,7 +1086,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1168,7 +1112,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1178,16 +1122,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1207,10 +1150,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1239,14 +1178,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1261,7 +1192,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1278,18 +1209,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1304,7 +1227,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1319,19 +1242,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. - :type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource or + IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1366,7 +1279,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1376,17 +1289,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1408,7 +1319,6 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource] @@ -1431,19 +1341,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, version=version, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1454,14 +1363,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1471,11 +1380,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1487,10 +1396,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, @@ -1511,7 +1416,6 @@ def list_for_cluster( :type version: list[str] :param expand: The expand expression to apply on the operation. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource] @@ -1534,19 +1438,18 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, expand=expand, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1557,14 +1460,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1574,11 +1477,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1590,10 +1493,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1611,23 +1510,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1637,11 +1535,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1658,14 +1552,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1694,7 +1580,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1703,17 +1589,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1732,23 +1614,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1758,11 +1639,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1779,14 +1656,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1815,7 +1684,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1824,17 +1693,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1853,23 +1718,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1879,11 +1743,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1900,14 +1760,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1936,7 +1788,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1945,17 +1797,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_remote_debugging_initial( self, @@ -1963,7 +1811,7 @@ def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -1992,7 +1840,7 @@ def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2002,16 +1850,15 @@ def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2031,10 +1878,6 @@ def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload def begin_enable_remote_debugging( self, @@ -2064,14 +1907,6 @@ def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2086,7 +1921,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2103,18 +1938,10 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2129,7 +1956,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> LROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -2144,20 +1971,9 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of LROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -2192,7 +2008,7 @@ def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2202,17 +2018,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2231,23 +2045,22 @@ def _disable_remote_debugging_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2267,10 +2080,6 @@ def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2286,14 +2095,6 @@ def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -2325,7 +2126,7 @@ def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2335,17 +2136,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def get_remote_debugging_config( @@ -2362,7 +2161,6 @@ def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -2381,23 +2179,22 @@ def get_remote_debugging_config( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2409,13 +2206,9 @@ def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace def get_log_file_url( @@ -2432,7 +2225,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -2451,23 +2243,22 @@ def get_log_file_url( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2481,13 +2272,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2495,7 +2282,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2521,7 +2308,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2531,16 +2318,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2550,11 +2336,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2584,14 +2366,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2604,7 +2378,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2621,18 +2395,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2645,7 +2411,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2660,20 +2426,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -2705,7 +2460,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2714,17 +2469,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2732,7 +2483,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2758,7 +2509,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2768,16 +2519,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2787,11 +2537,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2821,14 +2567,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2841,7 +2579,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2858,18 +2596,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2882,7 +2612,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2897,20 +2627,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -2942,7 +2661,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2951,17 +2670,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2969,7 +2684,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2995,7 +2710,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -3005,16 +2720,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -3024,11 +2738,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -3058,14 +2768,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -3078,7 +2780,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -3095,18 +2797,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -3119,7 +2813,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -3134,20 +2828,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :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: @@ -3179,7 +2862,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3188,14 +2871,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_dev_tool_portals_operations.py index b7ebf456f38..74d7648ad3d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -204,7 +204,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -228,17 +227,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -249,14 +247,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -266,11 +264,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -282,10 +280,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/devToolPortals" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -299,7 +293,6 @@ def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -318,22 +311,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -345,20 +337,16 @@ def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -384,7 +372,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -393,16 +381,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +409,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload def begin_create_or_update( self, @@ -452,14 +435,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -473,7 +448,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -488,18 +463,10 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -513,7 +480,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -526,20 +493,9 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource or IO[bytes] :return: An instance of LROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -573,7 +529,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -583,17 +539,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -612,22 +566,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -641,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -660,14 +609,6 @@ def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -695,7 +636,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -704,14 +645,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_gateway_custom_domains_operations.py index 896398629c2..d04a063c702 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -242,23 +241,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -270,13 +268,9 @@ def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -284,7 +278,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -310,7 +304,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -320,16 +314,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,10 +342,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -383,14 +372,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -405,7 +386,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -423,18 +404,10 @@ def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -449,7 +422,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -464,20 +437,9 @@ def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -512,7 +474,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -522,17 +484,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -551,23 +511,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -577,11 +536,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -598,14 +553,6 @@ def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -634,7 +581,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -643,17 +590,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -668,7 +611,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -692,18 +634,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -714,14 +655,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -731,11 +672,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -746,7 +687,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_gateway_route_configs_operations.py index ccf87392a2f..4541b532256 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -242,23 +241,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -270,13 +268,9 @@ def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -284,7 +278,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -310,7 +304,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -320,16 +314,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,10 +342,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload def begin_create_or_update( self, @@ -384,14 +373,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -406,7 +387,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -425,18 +406,10 @@ def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -451,7 +424,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -467,20 +440,9 @@ def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -515,7 +477,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -525,17 +487,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -554,23 +514,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,11 +539,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -601,14 +556,6 @@ def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -637,7 +584,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -646,17 +593,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -671,7 +614,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -695,18 +637,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -717,14 +658,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -734,11 +675,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -749,7 +690,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_gateways_operations.py index 84dac13caee..0da285ae669 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -299,7 +299,6 @@ def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -318,22 +317,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -345,20 +343,16 @@ def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -384,7 +378,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -393,16 +387,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -422,10 +415,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload def begin_create_or_update( self, @@ -451,14 +440,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -472,7 +453,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -487,18 +468,10 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -512,7 +485,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -525,19 +498,8 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. - :type gateway_resource: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + GatewayResource type or a IO[bytes] type. Required. + :type gateway_resource: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -571,7 +533,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -581,17 +543,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -610,22 +570,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -635,11 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -654,14 +609,6 @@ def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -689,7 +636,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -698,17 +645,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_env_secrets( @@ -723,7 +666,6 @@ def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -742,22 +684,21 @@ def list_env_secrets( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -769,13 +710,9 @@ def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -794,22 +731,21 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -823,11 +759,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_restart( @@ -842,14 +774,6 @@ def begin_restart( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -877,7 +801,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -888,17 +812,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: @@ -909,7 +829,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource] @@ -932,17 +851,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -953,14 +871,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -970,11 +888,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -986,10 +904,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload def validate_domain( self, @@ -1015,7 +929,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1027,7 +940,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1042,11 +955,10 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1058,7 +970,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -1071,13 +983,9 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidatePayload - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1105,7 +1013,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1114,16 +1022,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1135,10 +1042,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_monitoring_settings_operations.py index 6f63820264a..1bc426c572d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -182,21 +181,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,19 +206,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -246,7 +240,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -254,16 +248,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,10 +276,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -310,14 +299,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -330,7 +311,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -343,18 +324,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -367,7 +340,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -378,20 +351,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -424,7 +386,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -434,23 +396,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -476,7 +436,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -484,16 +444,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -513,10 +472,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -540,14 +495,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -560,7 +507,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -573,18 +520,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -597,7 +536,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -608,20 +547,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -654,7 +582,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -664,14 +592,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_operations.py index ff31902cafc..b2e50e73997 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.OperationDetail] @@ -102,14 +101,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -137,11 +135,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -152,5 +150,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_predefined_accelerators_operations.py index 27d5b36a46d..5686b76a552 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -231,7 +231,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -255,18 +254,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -277,14 +275,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -294,11 +292,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -310,10 +308,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace def get( self, @@ -334,7 +328,6 @@ def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -353,23 +346,22 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -381,13 +373,9 @@ def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -411,23 +399,22 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -441,11 +428,7 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_disable( @@ -467,14 +450,6 @@ def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -503,7 +478,7 @@ def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -512,17 +487,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -546,23 +517,22 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -576,11 +546,7 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_enable( @@ -602,14 +568,6 @@ def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -638,7 +596,7 @@ def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -647,14 +605,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_runtime_versions_operations.py index 8d4af0de820..acc0730fc4d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -96,18 +95,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -119,8 +117,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_service_registries_operations.py index 8685d71325d..93f28fe84c2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -215,22 +214,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -242,13 +240,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -267,22 +261,21 @@ def _create_or_update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -302,10 +295,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -319,14 +308,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -357,7 +338,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -367,17 +348,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -396,22 +375,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +399,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -440,14 +414,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -475,7 +441,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -484,17 +450,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -507,7 +469,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -531,17 +492,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -552,14 +512,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -569,11 +529,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,7 +544,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_services_operations.py index ee79dc71260..12ebaec3212 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -598,7 +598,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_supported_server_versions_request( +def build_list_supported_server_versions_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -658,7 +658,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -677,21 +676,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -703,16 +701,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -737,7 +735,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -745,16 +743,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -777,10 +774,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -803,14 +796,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -823,7 +808,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -836,18 +821,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -857,7 +834,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -867,19 +848,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -912,7 +882,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -922,17 +892,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -951,21 +919,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -975,11 +942,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -990,14 +953,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1024,7 +979,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1033,20 +988,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -1071,7 +1026,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1079,16 +1034,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1108,10 +1062,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -1134,14 +1084,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1154,7 +1096,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1167,18 +1109,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1188,7 +1122,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1197,20 +1135,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1243,7 +1170,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1253,17 +1180,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1274,7 +1199,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1293,21 +1217,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1319,13 +1242,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1350,7 +1269,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1361,7 +1279,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1374,11 +1292,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1389,7 +1306,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1400,13 +1317,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2023_12_01.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_12_01.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1434,7 +1347,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1442,16 +1355,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1463,13 +1375,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1482,7 +1390,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1501,21 +1408,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1525,11 +1431,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1540,7 +1442,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1559,21 +1460,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1585,13 +1485,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1610,35 +1506,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1649,14 +1540,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1683,7 +1566,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1692,17 +1575,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1721,35 +1600,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1760,14 +1634,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1794,7 +1660,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1803,17 +1669,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1832,21 +1694,20 @@ def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-stat api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_flush_vnet_dns_setting_request( + _request = build_flush_vnet_dns_setting_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._flush_vnet_dns_setting_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1859,11 +1720,7 @@ def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-stat response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _flush_vnet_dns_setting_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_flush_vnet_dns_setting( @@ -1876,14 +1733,6 @@ def begin_flush_vnet_dns_setting( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1910,7 +1759,7 @@ def begin_flush_vnet_dns_setting( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1921,17 +1770,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_flush_vnet_dns_setting.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_supported_apm_types( @@ -1944,7 +1789,6 @@ def list_supported_apm_types( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedApmType or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.SupportedApmType] @@ -1967,17 +1811,16 @@ def list_supported_apm_types( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_apm_types_request( + _request = build_list_supported_apm_types_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_apm_types.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1988,14 +1831,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("SupportedApmTypes", pipeline_response) @@ -2005,11 +1848,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2021,10 +1864,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_supported_apm_types.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes" - } - @distributed_trace def list_globally_enabled_apms( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -2036,7 +1875,6 @@ def list_globally_enabled_apms( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GloballyEnabledApms or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GloballyEnabledApms :raises ~azure.core.exceptions.HttpResponseError: @@ -2055,21 +1893,20 @@ def list_globally_enabled_apms( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None) - request = build_list_globally_enabled_apms_request( + _request = build_list_globally_enabled_apms_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_globally_enabled_apms.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2081,16 +1918,12 @@ def list_globally_enabled_apms( deserialized = self._deserialize("GloballyEnabledApms", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_globally_enabled_apms.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms" - } + return deserialized # type: ignore def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -2115,7 +1948,7 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme else: _json = self._serialize.body(apm, "ApmReference") - request = build_enable_apm_globally_request( + _request = build_enable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -2123,16 +1956,15 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme content_type=content_type, json=_json, content=_content, - template_url=self._enable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2146,11 +1978,7 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload def begin_enable_apm_globally( @@ -2174,14 +2002,6 @@ def begin_enable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2192,7 +2012,7 @@ def begin_enable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2205,18 +2025,10 @@ def begin_enable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the enable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2224,7 +2036,7 @@ def begin_enable_apm_globally( @distributed_trace def begin_enable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Enable an APM globally. @@ -2233,20 +2045,9 @@ def begin_enable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the enable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the enable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO[bytes] :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: @@ -2276,7 +2077,7 @@ def begin_enable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2287,20 +2088,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -2325,7 +2122,7 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(apm, "ApmReference") - request = build_disable_apm_globally_request( + _request = build_disable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -2333,16 +2130,15 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._disable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2356,11 +2152,7 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload def begin_disable_apm_globally( @@ -2384,14 +2176,6 @@ def begin_disable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2402,7 +2186,7 @@ def begin_disable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2415,18 +2199,10 @@ def begin_disable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the disable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2434,7 +2210,7 @@ def begin_disable_apm_globally( @distributed_trace def begin_disable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Disable an APM globally. @@ -2443,20 +2219,9 @@ def begin_disable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the disable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the disable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO[bytes] :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: @@ -2486,7 +2251,7 @@ def begin_disable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2497,17 +2262,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -2528,7 +2289,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2536,18 +2296,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2555,20 +2319,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2596,23 +2359,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2624,19 +2386,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource] @@ -2659,15 +2416,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2678,14 +2434,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2695,11 +2451,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2711,8 +2467,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -2720,7 +2474,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource] @@ -2743,16 +2496,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2763,14 +2515,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2780,11 +2532,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2796,10 +2548,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } - @distributed_trace def list_supported_server_versions( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -2811,7 +2559,6 @@ def list_supported_server_versions( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedServerVersion or the result of cls(response) :rtype: @@ -2835,17 +2582,16 @@ def list_supported_server_versions( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_server_versions_request( + _request = build_list_supported_server_versions_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_server_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2856,14 +2602,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("SupportedServerVersions", pipeline_response) @@ -2873,11 +2619,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2888,7 +2634,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list_supported_server_versions.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedServerVersions" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_skus_operations.py index 698e0b6b805..3bdfc08b711 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ResourceSku] :raises ~azure.core.exceptions.HttpResponseError: @@ -106,15 +105,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -125,14 +123,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -142,11 +140,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,5 +155,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_storages_operations.py index 3ec284db3d9..e219a0afd46 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2023_12_01.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -219,22 +218,21 @@ def get( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -246,20 +244,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -285,7 +279,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -294,16 +288,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -326,10 +319,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -355,14 +344,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -376,7 +357,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -391,18 +372,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -416,7 +389,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -429,19 +402,8 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. - :type storage_resource: ~azure.mgmt.appplatform.v2023_12_01.models.StorageResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + StorageResource type or a IO[bytes] type. Required. + :type storage_resource: ~azure.mgmt.appplatform.v2023_12_01.models.StorageResource or IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -475,7 +437,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -485,17 +447,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -514,22 +474,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -539,11 +498,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -558,14 +513,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -593,7 +540,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -602,17 +549,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -623,7 +566,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.StorageResource] @@ -646,17 +588,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -667,14 +608,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -684,11 +625,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -699,7 +640,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/_app_platform_management_client.py index 6ace1ffdb16..f65eae6db88 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from . import models as _models from .._serialization import Deserializer, Serializer @@ -166,7 +168,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -260,7 +280,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2024-01-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -280,7 +300,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/_configuration.py index 8e89cc48826..800fe8b41ec 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -19,7 +18,7 @@ from azure.core.credentials import TokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2024-01-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/_app_platform_management_client.py index 90704ab36a9..a5974e6ffad 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/_app_platform_management_client.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/_app_platform_management_client.py @@ -9,8 +9,10 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from .. import models as _models from ..._serialization import Deserializer, Serializer @@ -166,7 +168,25 @@ def __init__( self._config = AppPlatformManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -260,7 +280,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize, "2024-01-01-preview" ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -280,7 +302,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/_configuration.py index 30b2ffbd30e..5c113976459 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/_configuration.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/_configuration.py @@ -8,7 +8,6 @@ from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -19,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -36,7 +35,6 @@ class AppPlatformManagementClientConfiguration(Configuration): # pylint: disabl """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AppPlatformManagementClientConfiguration, self).__init__(**kwargs) api_version: str = kwargs.pop("api_version", "2024-01-01-preview") if credential is None: @@ -49,6 +47,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None: self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_api_portal_custom_domains_operations.py index cd62b1d8f81..6b7baa3a7b7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_api_portals_operations.py index 38097b2f41f..4d78b3a3ae6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ async def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -97,22 +96,21 @@ async def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -124,20 +122,16 @@ async def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -165,7 +159,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -174,16 +168,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,10 +196,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload async def begin_create_or_update( self, @@ -232,14 +221,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -253,7 +234,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +249,10 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -293,7 +266,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -306,20 +279,9 @@ async def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -355,7 +317,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -365,17 +327,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -396,22 +356,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,11 +380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -440,14 +395,6 @@ async def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -477,7 +424,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -486,17 +433,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -509,7 +452,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.ApiPortalResource] @@ -534,17 +476,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -555,14 +496,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -572,11 +513,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,10 +529,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload async def validate_domain( self, @@ -618,7 +555,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -630,7 +566,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -645,11 +581,10 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -661,7 +596,7 @@ async def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -674,13 +609,9 @@ async def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -710,7 +641,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -719,16 +650,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -740,10 +670,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_apms_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_apms_operations.py index 292ce9c11ac..779867bfc67 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_apms_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_apms_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -72,7 +72,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApmResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmResource] @@ -97,17 +96,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -118,14 +116,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApmResourceCollection", pipeline_response) @@ -135,11 +133,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -151,10 +149,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -168,7 +162,6 @@ async def get( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmResource :raises ~azure.core.exceptions.HttpResponseError: @@ -189,22 +182,21 @@ async def get( ) cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -216,20 +208,16 @@ async def get( deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> _models.ApmResource: error_map = { @@ -257,7 +245,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(apm_resource, "ApmResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, @@ -266,16 +254,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -295,10 +282,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } - @overload async def begin_create_or_update( self, @@ -324,14 +307,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -345,7 +320,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: IO, + apm_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -360,18 +335,10 @@ async def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Required. - :type apm_resource: IO + :type apm_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -385,7 +352,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApmResource]: """Create or update an APM. @@ -398,19 +365,8 @@ async def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Is either a ApmResource - type or a IO type. Required. - :type apm_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApmResource or the result of cls(response) :rtype: @@ -446,7 +402,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -456,17 +412,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApmResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return AsyncLROPoller[_models.ApmResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -487,22 +441,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -516,11 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -535,14 +484,6 @@ async def begin_delete( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_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: @@ -572,7 +513,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -583,17 +524,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_secret_keys( @@ -608,7 +545,6 @@ async def list_secret_keys( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmSecretKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmSecretKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -629,22 +565,21 @@ async def list_secret_keys( ) cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None) - request = build_list_secret_keys_request( + _request = build_list_secret_keys_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_secret_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -656,10 +591,6 @@ async def list_secret_keys( deserialized = self._deserialize("ApmSecretKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_secret_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_application_accelerators_operations.py index f402ca99108..073b7211df4 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -328,14 +311,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -349,7 +324,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -365,18 +340,10 @@ async def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -390,7 +357,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -403,20 +370,9 @@ async def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -452,7 +408,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -462,17 +418,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -493,22 +447,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -522,11 +475,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -541,14 +490,6 @@ async def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -578,7 +519,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -587,14 +528,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_application_live_views_operations.py index af826a9aa84..634de7dfda8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -520,11 +473,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -539,14 +488,6 @@ async def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -576,7 +517,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -585,14 +526,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_apps_operations.py index e8a3ea28a23..c97d7813a11 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,23 +106,22 @@ async def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,20 +133,16 @@ async def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -176,7 +170,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -185,16 +179,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -217,10 +210,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_create_or_update( self, @@ -246,14 +235,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -267,7 +248,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -320,19 +293,8 @@ async def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -368,7 +330,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -378,17 +340,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -409,22 +369,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,11 +393,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -453,14 +408,6 @@ async def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -490,7 +437,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -499,24 +446,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -544,7 +487,7 @@ async def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -553,16 +496,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -582,10 +524,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload async def begin_update( self, @@ -611,14 +549,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -632,7 +562,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -647,18 +577,10 @@ async def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -672,7 +594,7 @@ async def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -684,20 +606,9 @@ async def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.AppResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -733,7 +644,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -743,17 +654,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: @@ -764,7 +673,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.AppResource] @@ -789,17 +697,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -810,14 +717,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -827,11 +734,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -843,10 +750,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace_async async def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -860,7 +763,6 @@ async def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -881,22 +783,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -908,20 +809,16 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore async def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -949,7 +846,7 @@ async def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -958,16 +855,15 @@ async def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -987,10 +883,6 @@ async def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload async def begin_set_active_deployments( self, @@ -1017,14 +909,6 @@ async def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1038,7 +922,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1053,18 +937,10 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1078,7 +954,7 @@ async def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1091,20 +967,9 @@ async def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of AsyncLROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1140,7 +1005,7 @@ async def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1150,17 +1015,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload async def validate_domain( @@ -1188,7 +1051,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1200,7 +1062,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1215,11 +1077,10 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1231,7 +1092,7 @@ async def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1244,13 +1105,9 @@ async def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1280,7 +1137,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1289,16 +1146,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1310,10 +1166,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_bindings_operations.py index 9fc502c4c9f..a7e5356e4dd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -705,20 +627,9 @@ async def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.BindingResource] @@ -815,18 +723,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -837,14 +744,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -854,11 +761,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -869,7 +776,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_build_service_agent_pool_operations.py index 13362089883..aa08a44a937 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -174,7 +168,6 @@ async def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -195,23 +188,22 @@ async def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -223,13 +215,9 @@ async def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore async def _update_put_initial( self, @@ -237,7 +225,7 @@ async def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -265,7 +253,7 @@ async def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -275,16 +263,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -304,10 +291,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload async def begin_update_put( self, @@ -337,14 +320,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -359,7 +334,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -376,18 +351,10 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -402,7 +369,7 @@ async def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -417,20 +384,9 @@ async def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -467,7 +423,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -477,14 +433,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_build_service_builder_operations.py index cab08c3a360..45f9e49381d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,10 +201,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload async def begin_create_or_update( self, @@ -240,14 +229,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -262,7 +243,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -279,18 +260,10 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -305,7 +278,7 @@ async def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -320,20 +293,9 @@ async def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -370,7 +332,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -380,17 +342,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -411,23 +371,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -437,11 +396,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -458,14 +413,6 @@ async def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -496,7 +443,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -505,17 +452,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -530,7 +473,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.BuilderResource] @@ -555,18 +497,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -577,14 +518,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -594,11 +535,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -610,10 +551,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace_async async def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -629,7 +566,6 @@ async def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -650,23 +586,22 @@ async def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -678,10 +613,6 @@ async def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_build_service_operations.py index 2690280c2ca..5b98cd8b1fd 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildService] @@ -109,17 +108,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -130,14 +128,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -147,11 +145,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -163,10 +161,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace_async async def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -180,7 +174,6 @@ async def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -201,22 +194,21 @@ async def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,20 +220,16 @@ async def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> _models.BuildService: error_map = { @@ -269,7 +257,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(build_service, "BuildService") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -278,16 +266,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,10 +294,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } - @overload async def begin_create_or_update( self, @@ -336,14 +319,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -357,7 +332,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: IO, + build_service: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -372,18 +347,10 @@ async def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Required. - :type build_service: IO + :type build_service: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -397,7 +364,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildService]: """Create a build service resource. @@ -410,19 +377,9 @@ async def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Is either a BuildService type or a - IO type. Required. - :type build_service: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildService or + IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildService or the result of cls(response) :rtype: @@ -458,7 +415,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -470,17 +427,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildService].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return AsyncLROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_builds( @@ -495,7 +450,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.Build] @@ -520,18 +474,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -542,14 +495,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -559,11 +512,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -575,10 +528,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace_async async def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -594,7 +543,6 @@ async def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -615,23 +563,22 @@ async def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -643,13 +590,9 @@ async def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload async def create_or_update_build( @@ -679,7 +622,6 @@ async def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -692,7 +634,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -709,11 +651,10 @@ async def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -726,7 +667,7 @@ async def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -740,13 +681,9 @@ async def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2024_01_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2024_01_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -776,7 +713,7 @@ async def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -786,16 +723,15 @@ async def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -815,10 +751,6 @@ async def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - async def _delete_build_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> None: @@ -838,23 +770,22 @@ async def _delete_build_initial( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_build_request( + _request = build_delete_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_build_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -868,11 +799,7 @@ async def _delete_build_initial( # pylint: disable=inconsistent-return-statemen response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_build_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete_build( @@ -889,14 +816,6 @@ async def begin_delete_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_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: @@ -927,7 +846,7 @@ async def begin_delete_build( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -938,17 +857,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_build_results( @@ -965,7 +880,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildResult] @@ -990,19 +904,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1013,14 +926,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1030,11 +943,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1046,10 +959,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace_async async def get_build_result( self, @@ -1073,7 +982,6 @@ async def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1094,7 +1002,7 @@ async def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1102,16 +1010,15 @@ async def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1123,13 +1030,9 @@ async def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace_async async def get_build_result_log( @@ -1154,7 +1057,6 @@ async def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1175,7 +1077,7 @@ async def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1183,16 +1085,15 @@ async def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1204,13 +1105,9 @@ async def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace_async async def get_resource_upload_url( @@ -1225,7 +1122,6 @@ async def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1246,22 +1142,21 @@ async def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1273,13 +1168,9 @@ async def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_buildpacks( @@ -1294,7 +1185,6 @@ async def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1315,22 +1205,21 @@ async def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1342,13 +1231,9 @@ async def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_buildpack( @@ -1365,7 +1250,6 @@ async def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1386,23 +1270,22 @@ async def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1414,13 +1297,9 @@ async def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace_async async def list_supported_stacks( @@ -1435,7 +1314,6 @@ async def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1456,22 +1334,21 @@ async def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1483,13 +1360,9 @@ async def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace_async async def get_supported_stack( @@ -1506,7 +1379,6 @@ async def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1527,23 +1399,22 @@ async def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1555,10 +1426,6 @@ async def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_buildpack_binding_operations.py index dcfd32b3a73..50d388460c1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -100,17 +99,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -121,14 +119,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -138,11 +136,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,10 +152,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,7 +195,7 @@ async def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -210,16 +203,15 @@ async def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -231,13 +223,9 @@ async def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -246,7 +234,7 @@ async def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -274,7 +262,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -285,16 +273,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -314,10 +301,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload async def begin_create_or_update( self, @@ -351,14 +334,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -374,7 +349,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -394,18 +369,10 @@ async def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -421,7 +388,7 @@ async def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -438,20 +405,9 @@ async def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -489,7 +445,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -499,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -536,7 +490,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -544,16 +498,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -563,11 +516,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -592,14 +541,6 @@ async def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -631,7 +572,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -640,17 +581,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -667,7 +604,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -693,19 +629,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -716,14 +651,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -733,11 +668,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -748,7 +683,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_certificates_operations.py index b88a0521ad6..80706a2ea7b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.CertificateResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,17 +330,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -399,22 +359,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -424,11 +383,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -443,14 +398,6 @@ async def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -480,7 +427,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -489,17 +436,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -512,7 +455,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.CertificateResource] @@ -537,17 +479,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -558,14 +499,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -575,11 +516,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -590,7 +531,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_config_servers_operations.py index 12fa37ea7ac..f22553c4acc 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,7 +68,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -89,21 +88,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,19 +113,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -155,7 +149,7 @@ async def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -163,16 +157,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,10 +185,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_put( self, @@ -219,14 +208,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -239,7 +220,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -252,18 +233,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -276,7 +249,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -287,20 +260,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -335,7 +297,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -345,23 +307,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -389,7 +349,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -397,16 +357,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,10 +385,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload async def begin_update_patch( self, @@ -453,14 +408,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -473,7 +420,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -486,18 +433,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -510,7 +449,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerResource]: """Update the config server. @@ -521,20 +460,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -569,7 +497,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -579,23 +507,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -623,7 +549,7 @@ async def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -631,16 +557,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -660,10 +585,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload async def begin_validate( self, @@ -687,14 +608,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -707,7 +620,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -720,18 +633,10 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -744,7 +649,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -755,20 +660,9 @@ async def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -803,7 +697,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -815,14 +709,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_configuration_services_operations.py index 721906d88da..185f1c6a9fb 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,22 +97,21 @@ async def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,20 +123,16 @@ async def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -166,7 +160,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -175,16 +169,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -204,10 +197,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -272,18 +253,10 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -297,7 +270,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -311,20 +284,9 @@ async def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -360,7 +322,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -370,17 +332,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -401,22 +361,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -426,11 +385,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -445,14 +400,6 @@ async def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -482,7 +429,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -491,17 +438,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -514,7 +457,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -540,17 +482,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -561,14 +502,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -578,11 +519,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -594,16 +535,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - async def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -631,7 +568,7 @@ async def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -640,16 +577,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -669,10 +605,6 @@ async def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload async def begin_validate( self, @@ -698,14 +630,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -719,7 +643,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -734,18 +658,10 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -759,7 +675,7 @@ async def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -772,20 +688,9 @@ async def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -821,7 +726,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -833,24 +738,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _validate_resource_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> Optional[_models.ConfigurationServiceSettingsValidateResult]: error_map = { @@ -878,7 +781,7 @@ async def _validate_resource_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_validate_resource_request( + _request = build_validate_resource_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -887,16 +790,15 @@ async def _validate_resource_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_resource_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -914,13 +816,9 @@ async def _validate_resource_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _validate_resource_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return deserialized # type: ignore @overload async def begin_validate_resource( @@ -949,14 +847,6 @@ async def begin_validate_resource( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -970,7 +860,7 @@ async def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -986,18 +876,10 @@ async def begin_validate_resource( :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be validated. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1011,7 +893,7 @@ async def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service resource is valid. @@ -1024,20 +906,9 @@ async def begin_validate_resource( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be - validated. Is either a ConfigurationServiceResource type or a IO type. Required. + validated. Is either a ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1073,7 +944,7 @@ async def begin_validate_resource( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1085,14 +956,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_resource.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_container_registries_operations.py index ac14e6c9019..a11017b70d8 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_container_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_container_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContainerRegistryResource or the result of cls(response) :rtype: @@ -100,17 +99,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -121,14 +119,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) @@ -138,11 +136,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,10 +152,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -171,7 +165,6 @@ async def get( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ContainerRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -192,22 +185,21 @@ async def get( ) cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -219,20 +211,16 @@ async def get( deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> _models.ContainerRegistryResource: error_map = { @@ -260,7 +248,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -269,16 +257,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -298,10 +285,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } - @overload async def begin_create_or_update( self, @@ -328,14 +311,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -349,7 +324,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: IO, + container_registry_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -364,18 +339,10 @@ async def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Required. - :type container_registry_resource: IO + :type container_registry_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -389,7 +356,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ContainerRegistryResource]: """Create or update container registry resource. @@ -402,20 +369,9 @@ async def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Is either a - ContainerRegistryResource type or a IO type. Required. + ContainerRegistryResource type or a IO[bytes] type. Required. :type container_registry_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ContainerRegistryResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ContainerRegistryResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the result of cls(response) :rtype: @@ -451,7 +407,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -463,17 +419,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ContainerRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return AsyncLROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -494,22 +448,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -523,11 +476,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -542,14 +491,6 @@ async def begin_delete( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_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: @@ -579,7 +520,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -590,24 +531,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _validate_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.ContainerRegistryValidateResult]: error_map = { @@ -635,7 +572,7 @@ async def _validate_initial( else: _json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -644,16 +581,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -671,13 +607,9 @@ async def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return deserialized # type: ignore @overload async def begin_validate( @@ -705,14 +637,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -726,7 +650,7 @@ async def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: IO, + container_registry_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -741,18 +665,10 @@ async def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Required. - :type container_registry_properties: IO + :type container_registry_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -766,7 +682,7 @@ async def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]: """Check if the container registry properties are valid. @@ -779,20 +695,9 @@ async def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Is either a - ContainerRegistryProperties type or a IO type. Required. + ContainerRegistryProperties type or a IO[bytes] type. Required. :type container_registry_properties: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ContainerRegistryProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ContainerRegistryProperties or IO[bytes] :return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -828,7 +733,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -840,14 +745,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ContainerRegistryValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return AsyncLROPoller[_models.ContainerRegistryValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_custom_domains_operations.py index bc95c082894..c24a618da73 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -78,7 +78,6 @@ async def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -99,23 +98,22 @@ async def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,13 +125,9 @@ async def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -141,7 +135,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -169,7 +163,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -179,16 +173,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -211,10 +204,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -243,14 +232,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -265,7 +246,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -282,18 +263,10 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -308,7 +281,7 @@ async def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -323,20 +296,9 @@ async def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -373,7 +335,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -383,17 +345,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -414,23 +374,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -440,11 +399,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -461,14 +416,6 @@ async def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -499,7 +446,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -508,17 +455,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -526,7 +469,7 @@ async def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -554,7 +497,7 @@ async def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -564,16 +507,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -593,10 +535,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload async def begin_update( self, @@ -625,14 +563,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -647,7 +577,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -664,18 +594,10 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -690,7 +612,7 @@ async def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -705,20 +627,9 @@ async def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -755,7 +666,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -765,17 +676,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -790,7 +699,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -816,18 +724,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -838,14 +745,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -855,11 +762,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -870,7 +777,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_customized_accelerators_operations.py index c9431f0b56e..b63d71bda8a 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,7 +76,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -102,18 +101,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -124,14 +122,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -141,11 +139,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,10 +155,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace_async async def get( self, @@ -181,7 +175,6 @@ async def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -202,23 +195,22 @@ async def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -230,13 +222,9 @@ async def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -244,7 +232,7 @@ async def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -272,7 +260,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -282,16 +270,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -311,10 +298,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload async def begin_create_or_update( self, @@ -345,14 +328,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -367,7 +342,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -385,18 +360,10 @@ async def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -411,7 +378,7 @@ async def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -426,20 +393,9 @@ async def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -476,7 +432,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -486,17 +442,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -522,23 +476,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -552,11 +505,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -578,14 +527,6 @@ async def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -616,7 +557,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -625,17 +566,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _validate_initial( self, @@ -643,7 +580,7 @@ async def _validate_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: error_map = { @@ -671,7 +608,7 @@ async def _validate_initial( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -681,16 +618,15 @@ async def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -708,13 +644,9 @@ async def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore @overload async def begin_validate( @@ -745,14 +677,6 @@ async def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorValidateResult or the result of cls(response) :rtype: @@ -767,7 +691,7 @@ async def begin_validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -784,18 +708,10 @@ async def begin_validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorValidateResult or the result of cls(response) :rtype: @@ -810,7 +726,7 @@ async def begin_validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -825,20 +741,9 @@ async def begin_validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorValidateResult or the result of cls(response) :rtype: @@ -875,7 +780,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -885,14 +790,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.CustomizedAcceleratorValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return AsyncLROPoller[_models.CustomizedAcceleratorValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_deployments_operations.py index e4dec448043..47692f9e724 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -89,7 +89,6 @@ async def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -110,23 +109,22 @@ async def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -138,13 +136,9 @@ async def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -152,7 +146,7 @@ async def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -180,7 +174,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -190,16 +184,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -222,10 +215,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_create_or_update( self, @@ -255,14 +244,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -277,7 +258,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -294,18 +275,10 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -320,7 +293,7 @@ async def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -335,20 +308,9 @@ async def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -385,7 +347,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -395,17 +357,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -426,23 +386,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -452,11 +411,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -473,14 +428,6 @@ async def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -511,7 +458,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -520,17 +467,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( self, @@ -538,7 +481,7 @@ async def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -566,7 +509,7 @@ async def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -576,16 +519,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -605,10 +547,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload async def begin_update( self, @@ -638,14 +576,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -660,7 +590,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -677,18 +607,10 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -703,7 +625,7 @@ async def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -718,20 +640,9 @@ async def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -768,7 +679,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -778,17 +689,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -813,7 +722,6 @@ def list( :type version: list[str] :param expand: The expand expression to apply on the operation. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentResource] @@ -838,7 +746,7 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -846,12 +754,11 @@ def prepare_request(next_link=None): version=version, expand=expand, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -862,14 +769,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -879,11 +786,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -895,10 +802,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, @@ -919,7 +822,6 @@ def list_for_cluster( :type version: list[str] :param expand: The expand expression to apply on the operation. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentResource] @@ -944,19 +846,18 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, expand=expand, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -967,14 +868,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -984,11 +885,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1000,10 +901,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1023,23 +920,22 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1049,11 +945,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start( @@ -1070,14 +962,6 @@ async def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1108,7 +992,7 @@ async def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1117,17 +1001,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1148,23 +1028,22 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,11 +1053,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop( @@ -1195,14 +1070,6 @@ async def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1233,7 +1100,7 @@ async def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1242,17 +1109,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1273,23 +1136,22 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1299,11 +1161,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_restart( @@ -1320,14 +1178,6 @@ async def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1358,7 +1208,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1367,17 +1217,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_remote_debugging_initial( self, @@ -1385,7 +1231,7 @@ async def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -1416,7 +1262,7 @@ async def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1426,16 +1272,15 @@ async def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1455,10 +1300,6 @@ async def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload async def begin_enable_remote_debugging( self, @@ -1488,14 +1329,6 @@ async def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1510,7 +1343,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1527,18 +1360,10 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -1553,7 +1378,7 @@ async def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> AsyncLROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -1568,20 +1393,9 @@ async def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -1618,7 +1432,7 @@ async def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1628,17 +1442,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1659,23 +1471,22 @@ async def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1695,10 +1506,6 @@ async def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace_async async def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1714,14 +1521,6 @@ async def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -1755,7 +1554,7 @@ async def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1765,17 +1564,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def get_remote_debugging_config( @@ -1792,7 +1589,6 @@ async def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -1813,23 +1609,22 @@ async def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1841,13 +1636,9 @@ async def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace_async async def get_log_file_url( @@ -1864,7 +1655,6 @@ async def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -1885,23 +1675,22 @@ async def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1915,13 +1704,9 @@ async def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -1929,7 +1714,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -1957,7 +1742,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1967,16 +1752,15 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1986,11 +1770,7 @@ async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-st raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_heap_dump( @@ -2021,14 +1801,6 @@ async def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2041,7 +1813,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2058,18 +1830,10 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2082,7 +1846,7 @@ async def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Heap Dump. @@ -2097,20 +1861,9 @@ async def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2144,7 +1897,7 @@ async def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2153,17 +1906,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2171,7 +1920,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2199,7 +1948,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2209,16 +1958,15 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2228,11 +1976,7 @@ async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return- raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_generate_thread_dump( @@ -2263,14 +2007,6 @@ async def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2283,7 +2019,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2300,18 +2036,10 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2324,7 +2052,7 @@ async def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Generate Thread Dump. @@ -2339,20 +2067,9 @@ async def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2386,7 +2103,7 @@ async def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2395,17 +2112,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -2413,7 +2126,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2441,7 +2154,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2451,16 +2164,15 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2470,11 +2182,7 @@ async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload async def begin_start_jfr( @@ -2505,14 +2213,6 @@ async def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2525,7 +2225,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2542,18 +2242,10 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2566,7 +2258,7 @@ async def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Start JFR. @@ -2581,20 +2273,9 @@ async def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2628,7 +2309,7 @@ async def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2637,14 +2318,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_dev_tool_portals_operations.py index 07eb317c7c1..d72915fe417 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -73,7 +73,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -99,17 +98,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -120,14 +118,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -137,11 +135,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -153,10 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/devToolPortals" - } - @distributed_trace_async async def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -170,7 +164,6 @@ async def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -191,22 +184,21 @@ async def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,20 +210,16 @@ async def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -259,7 +247,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -268,16 +256,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -297,10 +284,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload async def begin_create_or_update( self, @@ -327,14 +310,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -348,7 +323,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -363,18 +338,10 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -388,7 +355,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -401,20 +368,9 @@ async def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -450,7 +406,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -460,17 +416,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -491,22 +445,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -520,11 +473,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_delete( @@ -539,14 +488,6 @@ async def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -576,7 +517,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -585,14 +526,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_eureka_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_eureka_servers_operations.py index 5fd1e1953c5..ee40b6ed203 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_eureka_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_eureka_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -70,7 +70,6 @@ async def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResourceCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.EurekaServerResourceCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -91,21 +90,20 @@ async def list( ) cls: ClsType[_models.EurekaServerResourceCollection] = kwargs.pop("cls", None) - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -117,13 +115,9 @@ async def list( deserialized = self._deserialize("EurekaServerResourceCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers" - } + return deserialized # type: ignore @distributed_trace_async async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.EurekaServerResource: @@ -134,7 +128,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.EurekaServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -155,21 +148,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -181,19 +173,15 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -221,7 +209,7 @@ async def _update_put_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -229,16 +217,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -261,10 +248,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload async def begin_update_put( self, @@ -288,14 +271,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -308,7 +283,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -321,18 +296,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -345,7 +312,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -356,20 +323,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -404,7 +360,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -417,23 +373,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return AsyncLROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -461,7 +415,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -469,16 +423,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -501,10 +454,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload async def begin_update_patch( self, @@ -528,14 +477,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -548,7 +489,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -561,18 +502,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -585,7 +518,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -596,20 +529,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -644,7 +566,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -656,14 +578,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return AsyncLROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_gateway_custom_domains_operations.py index a497f3afe21..c2cda1e6d4e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload async def begin_create_or_update( self, @@ -241,14 +230,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -263,7 +244,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -281,18 +262,10 @@ async def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -307,7 +280,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -322,20 +295,9 @@ async def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -372,7 +334,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -382,17 +344,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -413,23 +373,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -439,11 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -460,14 +415,6 @@ async def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -498,7 +445,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -507,17 +454,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -532,7 +475,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -558,18 +500,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -580,14 +521,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -597,11 +538,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -612,7 +553,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_gateway_route_configs_operations.py index ebfe57cdfae..4211b6f3be5 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ async def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -98,23 +97,22 @@ async def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -126,13 +124,9 @@ async def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, @@ -140,7 +134,7 @@ async def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -178,16 +172,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,10 +200,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload async def begin_create_or_update( self, @@ -242,14 +231,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -264,7 +245,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -283,18 +264,10 @@ async def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -309,7 +282,7 @@ async def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -325,20 +298,9 @@ async def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -375,7 +337,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -385,17 +347,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -416,23 +376,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -442,11 +401,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -463,14 +418,6 @@ async def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -501,7 +448,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -510,17 +457,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -535,7 +478,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -561,18 +503,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -583,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -600,11 +541,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -615,7 +556,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_gateways_operations.py index fe68085fd0b..e9241b3f935 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ async def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -100,22 +99,21 @@ async def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -127,20 +125,16 @@ async def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -168,7 +162,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -177,16 +171,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -206,10 +199,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +224,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -256,7 +237,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -271,18 +252,10 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -296,7 +269,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -309,20 +282,9 @@ async def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -358,7 +320,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -368,24 +330,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_capacity_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> Optional[_models.GatewayResource]: error_map = { @@ -413,7 +373,7 @@ async def _update_capacity_initial( else: _json = self._serialize.body(gateway_capacity_resource, "SkuObject") - request = build_update_capacity_request( + _request = build_update_capacity_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -422,16 +382,15 @@ async def _update_capacity_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_capacity_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,13 +408,9 @@ async def _update_capacity_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_capacity_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore @overload async def begin_update_capacity( @@ -482,14 +437,6 @@ async def begin_update_capacity( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -503,7 +450,7 @@ async def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: IO, + gateway_capacity_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -518,18 +465,10 @@ async def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Required. - :type gateway_capacity_resource: IO + :type gateway_capacity_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -543,7 +482,7 @@ async def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.GatewayResource]: """Operation to update an exiting Spring Cloud Gateway capacity. @@ -556,20 +495,9 @@ async def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a - SkuObject type or a IO type. Required. + SkuObject type or a IO[bytes] type. Required. :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.SkuObject - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -605,7 +533,7 @@ async def begin_update_capacity( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -617,17 +545,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_capacity.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -648,22 +574,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -673,11 +598,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -692,14 +613,6 @@ async def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -729,7 +642,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -738,17 +651,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def list_env_secrets( @@ -763,7 +672,6 @@ async def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -784,22 +692,21 @@ async def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -811,13 +718,9 @@ async def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -838,22 +741,21 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -867,11 +769,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_restart( @@ -886,14 +784,6 @@ async def begin_restart( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -923,7 +813,7 @@ async def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -934,17 +824,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -957,7 +843,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayResource] @@ -982,17 +867,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +887,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -1020,11 +904,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,10 +920,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload async def validate_domain( self, @@ -1066,7 +946,6 @@ async def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1078,7 +957,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1093,11 +972,10 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1109,7 +987,7 @@ async def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -1122,13 +1000,9 @@ async def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1158,7 +1032,7 @@ async def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1167,16 +1041,15 @@ async def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1188,10 +1061,6 @@ async def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_monitoring_settings_operations.py index 5ed63268001..3352d0d535e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -69,7 +69,6 @@ async def get( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -90,21 +89,20 @@ async def get( ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -116,19 +114,15 @@ async def get( deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore async def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -156,7 +150,7 @@ async def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -164,16 +158,15 @@ async def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -193,10 +186,6 @@ async def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_put( self, @@ -220,14 +209,6 @@ async def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -240,7 +221,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -253,18 +234,10 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -277,7 +250,7 @@ async def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -288,20 +261,9 @@ async def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -336,7 +298,7 @@ async def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -346,23 +308,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -390,7 +350,7 @@ async def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -398,16 +358,15 @@ async def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -427,10 +386,6 @@ async def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload async def begin_update_patch( self, @@ -454,14 +409,6 @@ async def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -474,7 +421,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -487,18 +434,10 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -511,7 +450,7 @@ async def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -522,20 +461,9 @@ async def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -570,7 +498,7 @@ async def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -580,14 +508,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_operations.py index f98b6bcac83..da9d89541b7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.OperationDetail] @@ -82,14 +81,13 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -100,14 +98,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -117,11 +115,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,5 +130,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_predefined_accelerators_operations.py index 377cee06086..ff27283a7d6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -100,18 +99,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -139,11 +137,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,10 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace_async async def get( self, @@ -179,7 +173,6 @@ async def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -200,23 +193,22 @@ async def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,13 +220,9 @@ async def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore async def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -260,23 +248,22 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -290,11 +277,7 @@ async def _disable_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_disable( @@ -316,14 +299,6 @@ async def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -354,7 +329,7 @@ async def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -363,17 +338,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -399,23 +370,22 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,11 +399,7 @@ async def _enable_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_enable( @@ -455,14 +421,6 @@ async def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -493,7 +451,7 @@ async def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -502,14 +460,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_runtime_versions_operations.py index b1e5f335c8f..66def19d4fb 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -55,7 +55,6 @@ def __init__(self, *args, **kwargs) -> None: async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -76,18 +75,17 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -99,8 +97,6 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_service_registries_operations.py index 8bf9017a310..9cb63fa574d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,7 +74,6 @@ async def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -95,22 +94,21 @@ async def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,13 +120,9 @@ async def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -149,22 +143,21 @@ async def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -184,10 +177,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -201,14 +190,6 @@ async def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -241,7 +222,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -251,17 +232,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -282,22 +261,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,11 +285,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -326,14 +300,6 @@ async def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -363,7 +329,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -372,17 +338,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -395,7 +357,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -421,17 +382,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -442,14 +402,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -459,11 +419,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -474,7 +434,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_services_operations.py index b7c1cd79e45..1b54d2d9253 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,7 +86,6 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -107,21 +106,20 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,16 +131,16 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -169,7 +167,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -177,16 +175,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -209,10 +206,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_create_or_update( self, @@ -235,14 +228,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -255,7 +240,7 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -268,18 +253,10 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -289,7 +266,11 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -299,19 +280,8 @@ async def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -346,7 +316,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -356,17 +326,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -387,21 +355,20 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -411,11 +378,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -426,14 +389,6 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -462,7 +417,7 @@ async def begin_delete(self, resource_group_name: str, service_name: str, **kwar def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -471,20 +426,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -511,7 +466,7 @@ async def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -519,16 +474,15 @@ async def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,10 +502,6 @@ async def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload async def begin_update( self, @@ -574,14 +524,6 @@ async def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -594,7 +536,7 @@ async def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -607,18 +549,10 @@ async def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -628,7 +562,11 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -637,20 +575,9 @@ async def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceResource or IO[bytes] :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -685,7 +612,7 @@ async def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -695,17 +622,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -716,7 +641,6 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -737,21 +661,20 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -763,13 +686,9 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload async def regenerate_test_key( @@ -794,7 +713,6 @@ async def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -805,7 +723,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -818,11 +736,10 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -833,7 +750,7 @@ async def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -844,13 +761,9 @@ async def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2024_01_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -880,7 +793,7 @@ async def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -888,16 +801,15 @@ async def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -909,13 +821,9 @@ async def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace_async async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -928,7 +836,6 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -949,21 +856,20 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -973,11 +879,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def enable_test_endpoint( @@ -990,7 +892,6 @@ async def enable_test_endpoint( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1011,21 +912,20 @@ async def enable_test_endpoint( ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1037,13 +937,9 @@ async def enable_test_endpoint( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1064,35 +960,30 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1103,14 +994,6 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1139,7 +1022,7 @@ async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1148,17 +1031,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1179,35 +1058,30 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1218,14 +1092,6 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1254,7 +1120,7 @@ async def begin_start(self, resource_group_name: str, service_name: str, **kwarg def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1263,17 +1129,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1294,21 +1156,20 @@ async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-retur ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_flush_vnet_dns_setting_request( + _request = build_flush_vnet_dns_setting_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._flush_vnet_dns_setting_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1321,11 +1182,7 @@ async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-retur response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _flush_vnet_dns_setting_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace_async async def begin_flush_vnet_dns_setting( @@ -1338,14 +1195,6 @@ async def begin_flush_vnet_dns_setting( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1374,7 +1223,7 @@ async def begin_flush_vnet_dns_setting( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1385,17 +1234,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_flush_vnet_dns_setting.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_supported_apm_types( @@ -1408,7 +1253,6 @@ def list_supported_apm_types( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedApmType or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.SupportedApmType] @@ -1433,17 +1277,16 @@ def list_supported_apm_types( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_apm_types_request( + _request = build_list_supported_apm_types_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_apm_types.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1454,14 +1297,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("SupportedApmTypes", pipeline_response) @@ -1471,11 +1314,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1487,10 +1330,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_supported_apm_types.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes" - } - @distributed_trace_async async def list_globally_enabled_apms( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1502,7 +1341,6 @@ async def list_globally_enabled_apms( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GloballyEnabledApms or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.GloballyEnabledApms :raises ~azure.core.exceptions.HttpResponseError: @@ -1523,21 +1361,20 @@ async def list_globally_enabled_apms( ) cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None) - request = build_list_globally_enabled_apms_request( + _request = build_list_globally_enabled_apms_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_globally_enabled_apms.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1549,16 +1386,12 @@ async def list_globally_enabled_apms( deserialized = self._deserialize("GloballyEnabledApms", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_globally_enabled_apms.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms" - } + return deserialized # type: ignore async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1585,7 +1418,7 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s else: _json = self._serialize.body(apm, "ApmReference") - request = build_enable_apm_globally_request( + _request = build_enable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1593,16 +1426,15 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s content_type=content_type, json=_json, content=_content, - template_url=self._enable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1616,11 +1448,7 @@ async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-s response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload async def begin_enable_apm_globally( @@ -1644,14 +1472,6 @@ async def begin_enable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1662,7 +1482,7 @@ async def begin_enable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1675,18 +1495,10 @@ async def begin_enable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the enable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1694,7 +1506,7 @@ async def begin_enable_apm_globally( @distributed_trace_async async def begin_enable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Enable an APM globally. @@ -1703,20 +1515,9 @@ async def begin_enable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the enable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the enable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmReference or IO[bytes] :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: @@ -1748,7 +1549,7 @@ async def begin_enable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1760,20 +1561,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1800,7 +1597,7 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- else: _json = self._serialize.body(apm, "ApmReference") - request = build_disable_apm_globally_request( + _request = build_disable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1808,16 +1605,15 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- content_type=content_type, json=_json, content=_content, - template_url=self._disable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1831,11 +1627,7 @@ async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return- response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload async def begin_disable_apm_globally( @@ -1859,14 +1651,6 @@ async def begin_disable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -1877,7 +1661,7 @@ async def begin_disable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1890,18 +1674,10 @@ async def begin_disable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the disable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -1909,7 +1685,7 @@ async def begin_disable_apm_globally( @distributed_trace_async async def begin_disable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Disable an APM globally. @@ -1918,20 +1694,9 @@ async def begin_disable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the disable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the disable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmReference or IO[bytes] :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: @@ -1963,7 +1728,7 @@ async def begin_disable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast( @@ -1975,17 +1740,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload async def check_name_availability( @@ -2006,7 +1767,6 @@ async def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2014,18 +1774,22 @@ async def check_name_availability( @overload async def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2033,20 +1797,19 @@ async def check_name_availability( @distributed_trace_async async def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2024_01_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2076,23 +1839,22 @@ async def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2104,19 +1866,14 @@ async def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceResource] @@ -2141,15 +1898,14 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2160,14 +1916,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2177,11 +1933,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2193,8 +1949,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -2202,7 +1956,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceResource] @@ -2227,16 +1980,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2247,14 +1999,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2264,11 +2016,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2280,10 +2032,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } - @distributed_trace def list_supported_server_versions( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -2295,7 +2043,6 @@ def list_supported_server_versions( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedServerVersion or the result of cls(response) :rtype: @@ -2321,17 +2068,16 @@ def list_supported_server_versions( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_server_versions_request( + _request = build_list_supported_server_versions_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_server_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2342,14 +2088,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("SupportedServerVersions", pipeline_response) @@ -2359,11 +2105,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2374,7 +2120,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list_supported_server_versions.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedServerVersions" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_skus_operations.py index 5ba58529e0e..ff6cc606ed9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,7 +57,6 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.ResourceSku] @@ -82,15 +81,14 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -101,14 +99,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -118,11 +116,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,5 +131,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_storages_operations.py index 666ee260adf..8ce932570fe 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/aio/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,7 +75,6 @@ async def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -96,22 +95,21 @@ async def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -123,20 +121,16 @@ async def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore async def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -164,7 +158,7 @@ async def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -173,16 +167,15 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,10 +198,6 @@ async def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload async def begin_create_or_update( self, @@ -234,14 +223,6 @@ async def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -255,7 +236,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -270,18 +251,10 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -295,7 +268,7 @@ async def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.StorageResource]: """Create or update storage resource. @@ -308,20 +281,9 @@ async def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -357,7 +319,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -367,17 +329,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -398,22 +358,21 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -423,11 +382,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def begin_delete( @@ -442,14 +397,6 @@ async def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -479,7 +426,7 @@ async def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -488,17 +435,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -511,7 +454,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.StorageResource] @@ -536,17 +478,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -557,14 +498,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -574,11 +515,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,7 +530,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/models/_models_py3.py index b765eb542dd..962a30c4a8c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/models/_models_py3.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/models/_models_py3.py @@ -30,7 +30,7 @@ class AcceleratorAuthSetting(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AcceleratorBasicAuthSetting, AcceleratorPublicSetting, AcceleratorSshSetting - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -61,7 +61,7 @@ def __init__(self, **kwargs: Any) -> None: class AcceleratorBasicAuthSetting(AcceleratorAuthSetting): """Auth setting for basic auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -106,7 +106,7 @@ def __init__( class AcceleratorGitRepository(_serialization.Model): """AcceleratorGitRepository. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: Git repository URL for the accelerator. Required. :vartype url: str @@ -184,7 +184,7 @@ def __init__( class AcceleratorPublicSetting(AcceleratorAuthSetting): """Auth setting for public url. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -214,7 +214,7 @@ def __init__(self, *, ca_cert_resource_id: Optional[str] = None, **kwargs: Any) class AcceleratorSshSetting(AcceleratorAuthSetting): """Auth setting for SSH auth. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar auth_type: The type of the auth setting. Required. :vartype auth_type: str @@ -354,24 +354,6 @@ class ProxyResource(Resource): :vartype system_data: ~azure.mgmt.appplatform.v2024_01_01_preview.models.SystemData """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class ApiPortalCustomDomainResource(ProxyResource): """Custom domain of the API portal. @@ -699,7 +681,7 @@ class ApmProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: APM Type. Required. :vartype type: str @@ -751,7 +733,7 @@ def __init__( class ApmReference(_serialization.Model): """A reference to the APM. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of the APM. Required. :vartype resource_id: str @@ -1651,7 +1633,7 @@ class CustomPersistentDiskProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureFileVolume - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -1713,7 +1695,7 @@ def __init__( class AzureFileVolume(CustomPersistentDiskProperties): """The properties of the Azure File volume. Azure File shares are mounted as volumes. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the underlying resource to mount as a persistent disk. Required. "AzureFileVolume" @@ -2612,7 +2594,7 @@ class UserSourceInfo(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -2650,7 +2632,7 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: class BuildResultUserSourceInfo(UserSourceInfo): """Reference to a build result. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -3035,7 +3017,7 @@ class CertificateProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -3107,7 +3089,7 @@ def __init__(self, **kwargs: Any) -> None: class CertificateReference(_serialization.Model): """A reference to the certificate. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of the certificate. Required. :vartype resource_id: str @@ -3370,7 +3352,7 @@ def __init__( class ConfigServerGitProperty(_serialization.Model): """Property of git. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar repositories: Repositories of git. :vartype repositories: @@ -3680,7 +3662,7 @@ def __init__( self.repositories = repositories -class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar is_valid: Indicate if the configuration service settings are valid. @@ -3717,7 +3699,7 @@ def __init__( class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for Application Configuration Service. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -4075,7 +4057,7 @@ def __init__( self.refresh_interval_in_seconds = refresh_interval_in_seconds -class ConfigurationServiceSettingsValidateResult(_serialization.Model): +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long """Validation result for configuration service settings. :ivar git_property_validation_result: Validation result for configuration service settings. @@ -4131,7 +4113,7 @@ class ContainerRegistryCredentials(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ContainerRegistryBasicCredentials - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The credential type of the container registry credentials. Required. :vartype type: str @@ -4156,7 +4138,7 @@ def __init__(self, **kwargs: Any) -> None: class ContainerRegistryBasicCredentials(ContainerRegistryCredentials): """The basic authentication properties for the container registry resource. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The credential type of the container registry credentials. Required. :vartype type: str @@ -4203,7 +4185,7 @@ class ContainerRegistryProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar credentials: The credentials of the container registry resource. Required. :vartype credentials: @@ -4343,7 +4325,7 @@ class ContentCertificateProperties(CertificateProperties): 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -4477,7 +4459,7 @@ def __init__( class CustomContainerUserSourceInfo(UserSourceInfo): """Custom container user source info. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -4635,7 +4617,7 @@ def __init__( class CustomDomainValidatePayload(_serialization.Model): """Custom domain validate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name to be validated. Required. :vartype name: str @@ -4689,7 +4671,7 @@ class CustomizedAcceleratorProperties(_serialization.Model): 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. + All required parameters must be populated in order to send to server. :ivar provisioning_state: State of the customized accelerator. Known values are: "Creating", "Updating", "Succeeded", "Failed", "Deleting", and "Canceled". @@ -4898,7 +4880,7 @@ def __init__( class CustomPersistentDiskResource(_serialization.Model): """Custom persistent disk resource payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource payload. @@ -5882,7 +5864,7 @@ class ProbeAction(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ExecAction, HTTPGetAction, TCPSocketAction - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -5910,7 +5892,7 @@ def __init__(self, **kwargs: Any) -> None: class ExecAction(ProbeAction): """ExecAction describes a "run in container" action. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -6311,7 +6293,7 @@ class GatewayResponseCacheProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: GatewayLocalResponseCachePerInstanceProperties, GatewayLocalResponseCachePerRouteProperties - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar response_cache_type: The type of the response cache. Required. :vartype response_cache_type: str @@ -6338,10 +6320,10 @@ def __init__(self, **kwargs: Any) -> None: self.response_cache_type: Optional[str] = None -class GatewayLocalResponseCachePerInstanceProperties(GatewayResponseCacheProperties): +class GatewayLocalResponseCachePerInstanceProperties(GatewayResponseCacheProperties): # pylint: disable=name-too-long """Spring Cloud Gateway local response cache per instance properties. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar response_cache_type: The type of the response cache. Required. :vartype response_cache_type: str @@ -6376,10 +6358,10 @@ def __init__(self, *, size: Optional[str] = None, time_to_live: Optional[str] = self.time_to_live = time_to_live -class GatewayLocalResponseCachePerRouteProperties(GatewayResponseCacheProperties): +class GatewayLocalResponseCachePerRouteProperties(GatewayResponseCacheProperties): # pylint: disable=name-too-long """Spring Cloud Gateway local response cache per route properties. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar response_cache_type: The type of the response cache. Required. :vartype response_cache_type: str @@ -6998,7 +6980,7 @@ def __init__( class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes """Git repository property payload for config server. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar name: Name of the repository. Required. :vartype name: str @@ -7120,7 +7102,7 @@ def __init__(self, *, value: Optional[List[str]] = None, **kwargs: Any) -> None: class HTTPGetAction(ProbeAction): """HTTPGetAction describes an action based on HTTP Get requests. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -7349,7 +7331,7 @@ class UploadedUserSourceInfo(UserSourceInfo): JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo, WarUploadedUserSourceInfo - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7393,7 +7375,7 @@ def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str class JarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -7449,7 +7431,7 @@ class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=t 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. + All required parameters must be populated in order to send to server. :ivar type: The type of the certificate source. Required. :vartype type: str @@ -7554,7 +7536,7 @@ def __init__( class LoadedCertificate(_serialization.Model): """Loaded certificate payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar resource_id: Resource Id of loaded certificate. Required. :vartype resource_id: str @@ -7588,7 +7570,7 @@ def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs class LogFileUrlResponse(_serialization.Model): """Log file URL payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar url: URL of the log file. Required. :vartype url: str @@ -7656,7 +7638,7 @@ class MaintenanceScheduleConfiguration(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: WeeklyMaintenanceScheduleConfiguration - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar frequency: The frequency to run the maintenance job. Required. "Weekly" :vartype frequency: str or ~azure.mgmt.appplatform.v2024_01_01_preview.models.Frequency @@ -8070,7 +8052,7 @@ def __init__( class NameAvailabilityParameters(_serialization.Model): """Name availability parameters payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the resource to check name availability. Required. :vartype type: str @@ -8103,7 +8085,7 @@ def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Jar binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -8588,7 +8570,7 @@ class Probe(_serialization.Model): """Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive traffic. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar probe_action: The action of the probe. :vartype probe_action: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ProbeAction @@ -8709,7 +8691,7 @@ def __init__( class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". :vartype key_type: str or ~azure.mgmt.appplatform.v2024_01_01_preview.models.TestKeyType @@ -9752,7 +9734,7 @@ def __init__( class SkuCapacity(_serialization.Model): """The SKU capacity. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar minimum: Gets or sets the minimum. Required. :vartype minimum: int @@ -9826,7 +9808,7 @@ def __init__(self, *, sku: Optional["_models.Sku"] = None, **kwargs: Any) -> Non class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded Java source code binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -9967,7 +9949,7 @@ class StorageProperties(_serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: StorageAccount - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2024_01_01_preview.models.StorageType @@ -9992,7 +9974,7 @@ def __init__(self, **kwargs: Any) -> None: class StorageAccount(StorageProperties): """storage resource of type Azure Storage Account. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar storage_type: The type of the storage. Required. "StorageAccount" :vartype storage_type: str or ~azure.mgmt.appplatform.v2024_01_01_preview.models.StorageType @@ -10583,7 +10565,7 @@ def __init__( class TCPSocketAction(ProbeAction): """TCPSocketAction describes an action based on opening a socket. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: The type of the action to take to perform the health check. Required. Known values are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". @@ -10809,7 +10791,7 @@ def __init__(self, *, name: Optional[str] = None, messages: Optional[List[str]] class WarUploadedUserSourceInfo(UploadedUserSourceInfo): """Uploaded War binary for a deployment. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar type: Type of the source uploaded. Required. :vartype type: str @@ -10872,7 +10854,7 @@ class WeeklyMaintenanceScheduleConfiguration(MaintenanceScheduleConfiguration): 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. + All required parameters must be populated in order to send to server. :ivar frequency: The frequency to run the maintenance job. Required. "Weekly" :vartype frequency: str or ~azure.mgmt.appplatform.v2024_01_01_preview.models.Frequency diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_api_portal_custom_domains_operations.py index 2aa621f7f2e..edc7e5c0930 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_api_portal_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_api_portal_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: IO, + api_portal_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update operation. Required. - :type api_portal_custom_domain_resource: IO + :type api_portal_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, api_portal_name: str, domain_name: str, - api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO], + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalCustomDomainResource]: """Create or update the API portal custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the API portal custom domain. Required. :type domain_name: str :param api_portal_custom_domain_resource: The API portal custom domain for the create or update - operation. Is either a ApiPortalCustomDomainResource type or a IO type. Required. + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. :type api_portal_custom_domain_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApiPortalCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type api_portal_name: str :param domain_name: The name of the API portal custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_api_portals_operations.py index 722e96d06d8..0b96236cb6c 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_api_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_api_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -235,7 +235,6 @@ def get( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -256,22 +255,21 @@ def get( ) cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,20 +281,16 @@ def get( deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> _models.ApiPortalResource: error_map = { @@ -324,7 +318,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(api_portal_resource, "ApiPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -333,16 +327,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,10 +355,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } - @overload def begin_create_or_update( self, @@ -391,14 +380,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -412,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: IO, + api_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Required. - :type api_portal_resource: IO + :type api_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApiPortalResource or the result of cls(response) :rtype: @@ -452,7 +425,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, api_portal_name: str, - api_portal_resource: Union[_models.ApiPortalResource, IO], + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApiPortalResource]: """Create the default API portal or update the existing API portal. @@ -465,20 +438,9 @@ def begin_create_or_update( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param api_portal_resource: The API portal for the create or update operation. Is either a - ApiPortalResource type or a IO type. Required. + ApiPortalResource type or a IO[bytes] type. Required. :type api_portal_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApiPortalResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ApiPortalResource or the result of cls(response) :rtype: @@ -514,7 +476,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApiPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -524,17 +486,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApiPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any @@ -555,22 +515,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -580,11 +539,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apiPortals/{apiPortalName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -599,14 +554,6 @@ def begin_delete( :type service_name: str :param api_portal_name: The name of API portal. Required. :type api_portal_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: @@ -636,7 +583,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -645,17 +592,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: @@ -666,7 +609,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiPortalResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.ApiPortalResource] @@ -691,17 +633,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -712,14 +653,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) @@ -729,11 +670,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -745,10 +686,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" - } - @overload def validate_domain( self, @@ -775,7 +712,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -787,7 +723,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -802,11 +738,10 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -818,7 +753,7 @@ def validate_domain( resource_group_name: str, service_name: str, api_portal_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -831,13 +766,9 @@ def validate_domain( :param api_portal_name: The name of API portal. Required. :type api_portal_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -867,7 +798,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, api_portal_name=api_portal_name, @@ -876,16 +807,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -897,10 +827,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_apms_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_apms_operations.py index 2f3be8623dd..4bf1356c01f 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_apms_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_apms_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -228,7 +228,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApmResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmResource] @@ -253,17 +252,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -274,14 +272,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApmResourceCollection", pipeline_response) @@ -291,11 +289,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -307,10 +305,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms" - } - @distributed_trace def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any) -> _models.ApmResource: """Get the APM by name. @@ -322,7 +316,6 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmResource :raises ~azure.core.exceptions.HttpResponseError: @@ -343,22 +336,21 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar ) cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -370,20 +362,16 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> _models.ApmResource: error_map = { @@ -411,7 +399,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(apm_resource, "ApmResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, @@ -420,16 +408,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -449,10 +436,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } - @overload def begin_create_or_update( self, @@ -478,14 +461,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -499,7 +474,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: IO, + apm_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -514,18 +489,10 @@ def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Required. - :type apm_resource: IO + :type apm_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApmResource or the result of cls(response) :rtype: @@ -539,7 +506,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, apm_name: str, - apm_resource: Union[_models.ApmResource, IO], + apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApmResource]: """Create or update an APM. @@ -552,19 +519,8 @@ def begin_create_or_update( :param apm_name: The name of the APM. Required. :type apm_name: str :param apm_resource: Parameters for the create or update operation. Is either a ApmResource - type or a IO type. Required. - :type apm_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmResource or IO[bytes] :return: An instance of LROPoller that returns either ApmResource or the result of cls(response) :rtype: @@ -600,7 +556,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApmResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -610,17 +566,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApmResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return LROPoller[_models.ApmResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any @@ -641,22 +595,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -670,11 +623,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -689,14 +638,6 @@ def begin_delete( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_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: @@ -726,7 +667,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -737,17 +678,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_secret_keys( @@ -762,7 +699,6 @@ def list_secret_keys( :type service_name: str :param apm_name: The name of the APM. Required. :type apm_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApmSecretKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmSecretKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -783,22 +719,21 @@ def list_secret_keys( ) cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None) - request = build_list_secret_keys_request( + _request = build_list_secret_keys_request( resource_group_name=resource_group_name, service_name=service_name, apm_name=apm_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_secret_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -810,10 +745,6 @@ def list_secret_keys( deserialized = self._deserialize("ApmSecretKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_secret_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_application_accelerators_operations.py index 2a77853248e..cbbf7805ba7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_application_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_application_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -204,7 +204,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -230,17 +229,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -251,14 +249,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) @@ -268,11 +266,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -284,10 +282,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -301,7 +295,6 @@ def get( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -322,22 +315,21 @@ def get( ) cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,20 +341,16 @@ def get( deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationAcceleratorResource: error_map = { @@ -390,7 +378,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -399,16 +387,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,10 +415,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -459,14 +442,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -480,7 +455,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: IO, + application_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -496,18 +471,10 @@ def begin_create_or_update( :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update operation. Required. - :type application_accelerator_resource: IO + :type application_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -521,7 +488,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_accelerator_name: str, - application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO], + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationAcceleratorResource]: """Create or update the application accelerator. @@ -534,20 +501,9 @@ def begin_create_or_update( :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str :param application_accelerator_resource: The application accelerator for the create or update - operation. Is either a ApplicationAcceleratorResource type or a IO type. Required. + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. :type application_accelerator_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApplicationAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApplicationAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationAcceleratorResource or the result of cls(response) :rtype: @@ -583,7 +539,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -593,17 +549,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any @@ -624,22 +578,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -653,11 +606,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -672,14 +621,6 @@ def begin_delete( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_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: @@ -709,7 +650,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -718,14 +659,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_application_live_views_operations.py index b9c3238e062..58c0eb84771 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_application_live_views_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_application_live_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -204,7 +204,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -230,17 +229,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -251,14 +249,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) @@ -268,11 +266,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -284,10 +282,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -301,7 +295,6 @@ def get( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ApplicationLiveViewResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: @@ -322,22 +315,21 @@ def get( ) cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,20 +341,16 @@ def get( deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> _models.ApplicationLiveViewResource: error_map = { @@ -390,7 +378,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, @@ -399,16 +387,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,10 +415,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } - @overload def begin_create_or_update( self, @@ -458,14 +441,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -479,7 +454,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: IO, + application_live_view_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -494,18 +469,10 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Required. - :type application_live_view_resource: IO + :type application_live_view_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -519,7 +486,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, application_live_view_name: str, - application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO], + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ApplicationLiveViewResource]: """Create the default Application Live View or update the existing Application Live View. @@ -532,20 +499,9 @@ def begin_create_or_update( :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_name: str :param application_live_view_resource: Parameters for the update operation. Is either a - ApplicationLiveViewResource type or a IO type. Required. + ApplicationLiveViewResource type or a IO[bytes] type. Required. :type application_live_view_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApplicationLiveViewResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApplicationLiveViewResource or IO[bytes] :return: An instance of LROPoller that returns either ApplicationLiveViewResource or the result of cls(response) :rtype: @@ -581,7 +537,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -591,17 +547,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ApplicationLiveViewResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any @@ -622,22 +576,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_live_view_name=application_live_view_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -651,11 +604,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -670,14 +619,6 @@ def begin_delete( :type service_name: str :param application_live_view_name: The name of Application Live View. Required. :type application_live_view_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: @@ -707,7 +648,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -716,14 +657,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_apps_operations.py index 2566ef8cd32..eb69d40840b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_apps_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -352,7 +352,6 @@ def get( :type app_name: str :param sync_status: Indicates whether sync status. Default value is None. :type sync_status: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AppResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: @@ -373,23 +372,22 @@ def get( ) cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, sync_status=sync_status, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -401,20 +399,16 @@ def get( deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -442,7 +436,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -451,16 +445,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -483,10 +476,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_create_or_update( self, @@ -512,14 +501,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -533,7 +514,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -548,18 +529,10 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -573,7 +546,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Create a new App or update an exiting App. @@ -586,19 +559,8 @@ def begin_create_or_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the create or update operation. Is either a AppResource - type or a IO type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -634,7 +596,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -644,17 +606,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -675,22 +635,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -700,11 +659,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -719,14 +674,6 @@ def begin_delete( :type service_name: str :param app_name: The name of the App resource. Required. :type app_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: @@ -756,7 +703,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -765,24 +712,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -810,7 +753,7 @@ def _update_initial( else: _json = self._serialize.body(app_resource, "AppResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -819,16 +762,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -848,10 +790,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } - @overload def begin_update( self, @@ -877,14 +815,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -898,7 +828,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: IO, + app_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -913,18 +843,10 @@ def begin_update( :param app_name: The name of the App resource. Required. :type app_name: str :param app_resource: Parameters for the update operation. Required. - :type app_resource: IO + :type app_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -938,7 +860,7 @@ def begin_update( resource_group_name: str, service_name: str, app_name: str, - app_resource: Union[_models.AppResource, IO], + app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Operation to update an exiting App. @@ -950,20 +872,9 @@ def begin_update( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :param app_resource: Parameters for the update operation. Is either a AppResource type or a IO - type. Required. - :type app_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.AppResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.AppResource or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -999,7 +910,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1009,17 +920,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: @@ -1030,7 +939,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AppResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.AppResource] @@ -1055,17 +963,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1076,14 +983,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AppResourceCollection", pipeline_response) @@ -1093,11 +1000,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1109,10 +1016,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps" - } - @distributed_trace def get_resource_upload_url( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any @@ -1126,7 +1029,6 @@ def get_resource_upload_url( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1147,22 +1049,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1174,20 +1075,16 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl" - } + return deserialized # type: ignore def _set_active_deployments_initial( self, resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> _models.AppResource: error_map = { @@ -1215,7 +1112,7 @@ def _set_active_deployments_initial( else: _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") - request = build_set_active_deployments_request( + _request = build_set_active_deployments_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1224,16 +1121,15 @@ def _set_active_deployments_initial( content_type=content_type, json=_json, content=_content, - template_url=self._set_active_deployments_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1253,10 +1149,6 @@ def _set_active_deployments_initial( return deserialized # type: ignore - _set_active_deployments_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } - @overload def begin_set_active_deployments( self, @@ -1283,14 +1175,6 @@ def begin_set_active_deployments( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1304,7 +1188,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: IO, + active_deployment_collection: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1319,18 +1203,10 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Required. - :type active_deployment_collection: IO + :type active_deployment_collection: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 AppResource or the result of cls(response) :rtype: @@ -1344,7 +1220,7 @@ def begin_set_active_deployments( resource_group_name: str, service_name: str, app_name: str, - active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO], + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AppResource]: """Set existing Deployment under the app as active. @@ -1357,20 +1233,9 @@ def begin_set_active_deployments( :param app_name: The name of the App resource. Required. :type app_name: str :param active_deployment_collection: A list of Deployment name to be active. Is either a - ActiveDeploymentCollection type or a IO type. Required. + ActiveDeploymentCollection type or a IO[bytes] type. Required. :type active_deployment_collection: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ActiveDeploymentCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ActiveDeploymentCollection or IO[bytes] :return: An instance of LROPoller that returns either AppResource or the result of cls(response) :rtype: @@ -1406,7 +1271,7 @@ def begin_set_active_deployments( def get_long_running_output(pipeline_response): deserialized = self._deserialize("AppResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1416,17 +1281,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.AppResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_set_active_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments" - } + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload def validate_domain( @@ -1454,7 +1317,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1466,7 +1328,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1481,11 +1343,10 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1497,7 +1358,7 @@ def validate_domain( resource_group_name: str, service_name: str, app_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the resource name is valid as well as not in use. @@ -1510,13 +1371,9 @@ def validate_domain( :param app_name: The name of the App resource. Required. :type app_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1546,7 +1403,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1555,16 +1412,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1576,10 +1432,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_bindings_operations.py index f4a2f1c46af..66f939827e3 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_bindings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_bindings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Create a new Binding or update an exiting Binding. @@ -489,20 +462,9 @@ def begin_create_or_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the create or update operation. Is either a - BindingResource type or a IO type. Required. + BindingResource type or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, binding_name=binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/bindings/{bindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param binding_name: The name of the Binding resource. Required. :type binding_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> _models.BindingResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(binding_resource, "BindingResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: IO, + binding_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Required. - :type binding_resource: IO + :type binding_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BindingResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, binding_name: str, - binding_resource: Union[_models.BindingResource, IO], + binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BindingResource]: """Operation to update an exiting Binding. @@ -871,20 +793,9 @@ def begin_update( :param binding_name: The name of the Binding resource. Required. :type binding_name: str :param binding_resource: Parameters for the update operation. Is either a BindingResource type - or a IO type. Required. + or a IO[bytes] type. Required. :type binding_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BindingResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BindingResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}" - } + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BindingResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.BindingResource] @@ -981,18 +889,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1003,14 +910,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BindingResourceCollection", pipeline_response) @@ -1020,11 +927,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1035,7 +942,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_build_service_agent_pool_operations.py index ea650468e2d..3f21781ebe9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_build_service_agent_pool_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_build_service_agent_pool_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -183,7 +183,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -209,18 +208,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -231,14 +229,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) @@ -248,11 +246,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -264,10 +262,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any @@ -283,7 +277,6 @@ def get( :type build_service_name: str :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildServiceAgentPoolResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: @@ -304,23 +297,22 @@ def get( ) cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, agent_pool_name=agent_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -332,13 +324,9 @@ def get( deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return deserialized # type: ignore def _update_put_initial( self, @@ -346,7 +334,7 @@ def _update_put_initial( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> _models.BuildServiceAgentPoolResource: error_map = { @@ -374,7 +362,7 @@ def _update_put_initial( else: _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -384,16 +372,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -413,10 +400,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } - @overload def begin_update_put( self, @@ -446,14 +429,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -468,7 +443,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: IO, + agent_pool_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -485,18 +460,10 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Required. - :type agent_pool_resource: IO + :type agent_pool_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -511,7 +478,7 @@ def begin_update_put( service_name: str, build_service_name: str, agent_pool_name: str, - agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO], + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildServiceAgentPoolResource]: """Create or update build service agent pool. @@ -526,20 +493,9 @@ def begin_update_put( :param agent_pool_name: The name of the build service agent pool resource. Required. :type agent_pool_name: str :param agent_pool_resource: Parameters for the update operation. Is either a - BuildServiceAgentPoolResource type or a IO type. Required. + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. :type agent_pool_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildServiceAgentPoolResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the result of cls(response) :rtype: @@ -576,7 +532,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -586,14 +542,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}" - } + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_build_service_builder_operations.py index 64aeda8ea40..827b1c8816e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_build_service_builder_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_build_service_builder_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -261,7 +261,6 @@ def get( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuilderResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: @@ -282,23 +281,22 @@ def get( ) cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -310,13 +308,9 @@ def get( deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -324,7 +318,7 @@ def _create_or_update_initial( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> _models.BuilderResource: error_map = { @@ -352,7 +346,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(builder_resource, "BuilderResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -362,16 +356,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -391,10 +384,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } - @overload def begin_create_or_update( self, @@ -423,14 +412,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -445,7 +426,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: IO, + builder_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -462,18 +443,10 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Required. - :type builder_resource: IO + :type builder_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuilderResource or the result of cls(response) :rtype: @@ -488,7 +461,7 @@ def begin_create_or_update( service_name: str, build_service_name: str, builder_name: str, - builder_resource: Union[_models.BuilderResource, IO], + builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuilderResource]: """Create or update a KPack builder. @@ -503,20 +476,9 @@ def begin_create_or_update( :param builder_name: The name of the builder resource. Required. :type builder_name: str :param builder_resource: The target builder for the create or update operation. Is either a - BuilderResource type or a IO type. Required. + BuilderResource type or a IO[bytes] type. Required. :type builder_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuilderResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either BuilderResource or the result of cls(response) :rtype: @@ -553,7 +515,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuilderResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -563,17 +525,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuilderResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -594,23 +554,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -620,11 +579,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -641,14 +596,6 @@ def begin_delete( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_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: @@ -679,7 +626,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -688,17 +635,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -713,7 +656,6 @@ def list( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuilderResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.BuilderResource] @@ -738,18 +680,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -760,14 +701,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) @@ -777,11 +718,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -793,10 +734,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders" - } - @distributed_trace def list_deployments( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any @@ -812,7 +749,6 @@ def list_deployments( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentList or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: @@ -833,23 +769,22 @@ def list_deployments( ) cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) - request = build_list_deployments_request( + _request = build_list_deployments_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_deployments.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -861,10 +796,6 @@ def list_deployments( deserialized = self._deserialize("DeploymentList", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_deployments.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_build_service_operations.py index e72cae43924..b2551adb4c6 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_build_service_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_build_service_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -607,7 +607,6 @@ def list_build_services( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildService or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildService] @@ -632,17 +631,16 @@ def list_build_services( def prepare_request(next_link=None): if not next_link: - request = build_list_build_services_request( + _request = build_list_build_services_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_services.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -653,14 +651,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildServiceCollection", pipeline_response) @@ -670,11 +668,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -686,10 +684,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_services.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices" - } - @distributed_trace def get_build_service( self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any @@ -703,7 +697,6 @@ def get_build_service( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildService or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: @@ -724,22 +717,21 @@ def get_build_service( ) cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) - request = build_get_build_service_request( + _request = build_get_build_service_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_service.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,20 +743,16 @@ def get_build_service( deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_service.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> _models.BuildService: error_map = { @@ -792,7 +780,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(build_service, "BuildService") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -801,16 +789,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -830,10 +817,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } - @overload def begin_create_or_update( self, @@ -859,14 +842,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -880,7 +855,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: IO, + build_service: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -895,18 +870,10 @@ def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Required. - :type build_service: IO + :type build_service: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildService or the result of cls(response) :rtype: @@ -920,7 +887,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, build_service_name: str, - build_service: Union[_models.BuildService, IO], + build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildService]: """Create a build service resource. @@ -933,19 +900,9 @@ def begin_create_or_update( :param build_service_name: The name of the build service resource. Required. :type build_service_name: str :param build_service: Parameters for the create operation. Is either a BuildService type or a - IO type. Required. - :type build_service: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildService or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildService or + IO[bytes] :return: An instance of LROPoller that returns either BuildService or the result of cls(response) :rtype: @@ -981,7 +938,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildService", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -993,17 +950,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildService].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" - } + return LROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_builds( @@ -1018,7 +973,6 @@ def list_builds( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Build or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.Build] :raises ~azure.core.exceptions.HttpResponseError: @@ -1042,18 +996,17 @@ def list_builds( def prepare_request(next_link=None): if not next_link: - request = build_list_builds_request( + _request = build_list_builds_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_builds.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1064,14 +1017,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildCollection", pipeline_response) @@ -1081,11 +1034,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1097,10 +1050,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_builds.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds" - } - @distributed_trace def get_build( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any @@ -1116,7 +1065,6 @@ def get_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1137,23 +1085,22 @@ def get_build( ) cls: ClsType[_models.Build] = kwargs.pop("cls", None) - request = build_get_build_request( + _request = build_get_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1165,13 +1112,9 @@ def get_build( deserialized = self._deserialize("Build", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return deserialized # type: ignore @overload def create_or_update_build( @@ -1201,7 +1144,6 @@ def create_or_update_build( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1214,7 +1156,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: IO, + build: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1231,11 +1173,10 @@ def create_or_update_build( :param build_name: The name of the build resource. Required. :type build_name: str :param build: Parameters for the create or update operation. Required. - :type build: IO + :type build: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1248,7 +1189,7 @@ def create_or_update_build( service_name: str, build_service_name: str, build_name: str, - build: Union[_models.Build, IO], + build: Union[_models.Build, IO[bytes]], **kwargs: Any ) -> _models.Build: """Create or update a KPack build. @@ -1262,13 +1203,9 @@ def create_or_update_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :param build: Parameters for the create or update operation. Is either a Build type or a IO - type. Required. - :type build: ~azure.mgmt.appplatform.v2024_01_01_preview.models.Build or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2024_01_01_preview.models.Build or IO[bytes] :return: Build or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.Build :raises ~azure.core.exceptions.HttpResponseError: @@ -1298,7 +1235,7 @@ def create_or_update_build( else: _json = self._serialize.body(build, "Build") - request = build_create_or_update_build_request( + _request = build_create_or_update_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1308,16 +1245,15 @@ def create_or_update_build( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update_build.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1337,10 +1273,6 @@ def create_or_update_build( return deserialized # type: ignore - create_or_update_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } - def _delete_build_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> None: @@ -1360,23 +1292,22 @@ def _delete_build_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_build_request( + _request = build_delete_build_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_build_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1390,11 +1321,7 @@ def _delete_build_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_build_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete_build( @@ -1411,14 +1338,6 @@ def begin_delete_build( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_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: @@ -1449,7 +1368,7 @@ def begin_delete_build( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1460,17 +1379,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_build.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_build_results( @@ -1487,7 +1402,6 @@ def list_build_results( :type build_service_name: str :param build_name: The name of the build resource. Required. :type build_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildResult] @@ -1512,19 +1426,18 @@ def list_build_results( def prepare_request(next_link=None): if not next_link: - request = build_list_build_results_request( + _request = build_list_build_results_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, build_name=build_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_build_results.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1535,14 +1448,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildResultCollection", pipeline_response) @@ -1552,11 +1465,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1568,10 +1481,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_build_results.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results" - } - @distributed_trace def get_build_result( self, @@ -1595,7 +1504,6 @@ def get_build_result( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1616,7 +1524,7 @@ def get_build_result( ) cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) - request = build_get_build_result_request( + _request = build_get_build_result_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1624,16 +1532,15 @@ def get_build_result( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1645,13 +1552,9 @@ def get_build_result( deserialized = self._deserialize("BuildResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}" - } + return deserialized # type: ignore @distributed_trace def get_build_result_log( @@ -1676,7 +1579,6 @@ def get_build_result_log( :type build_name: str :param build_result_name: The name of the build result resource. Required. :type build_result_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildResultLog or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: @@ -1697,7 +1599,7 @@ def get_build_result_log( ) cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) - request = build_get_build_result_log_request( + _request = build_get_build_result_log_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -1705,16 +1607,15 @@ def get_build_result_log( build_result_name=build_result_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_build_result_log.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1726,13 +1627,9 @@ def get_build_result_log( deserialized = self._deserialize("BuildResultLog", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_build_result_log.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl" - } + return deserialized # type: ignore @distributed_trace def get_resource_upload_url( @@ -1747,7 +1644,6 @@ def get_resource_upload_url( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceUploadDefinition or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -1768,22 +1664,21 @@ def get_resource_upload_url( ) cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) - request = build_get_resource_upload_url_request( + _request = build_get_resource_upload_url_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_resource_upload_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1795,13 +1690,9 @@ def get_resource_upload_url( deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_resource_upload_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl" - } + return deserialized # type: ignore @distributed_trace def list_supported_buildpacks( @@ -1816,7 +1707,6 @@ def list_supported_buildpacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1837,22 +1727,21 @@ def list_supported_buildpacks( ) cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_buildpacks_request( + _request = build_list_supported_buildpacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_buildpacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1864,13 +1753,9 @@ def list_supported_buildpacks( deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_buildpacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_buildpack( @@ -1887,7 +1772,6 @@ def get_supported_buildpack( :type build_service_name: str :param buildpack_name: The name of the buildpack resource. Required. :type buildpack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedBuildpackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1908,23 +1792,22 @@ def get_supported_buildpack( ) cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) - request = build_get_supported_buildpack_request( + _request = build_get_supported_buildpack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, buildpack_name=buildpack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_buildpack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1936,13 +1819,9 @@ def get_supported_buildpack( deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_buildpack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}" - } + return deserialized # type: ignore @distributed_trace def list_supported_stacks( @@ -1957,7 +1836,6 @@ def list_supported_stacks( :type service_name: str :param build_service_name: The name of the build service resource. Required. :type build_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStacksCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -1978,22 +1856,21 @@ def list_supported_stacks( ) cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) - request = build_list_supported_stacks_request( + _request = build_list_supported_stacks_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_stacks.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2005,13 +1882,9 @@ def list_supported_stacks( deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_supported_stacks.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks" - } + return deserialized # type: ignore @distributed_trace def get_supported_stack( @@ -2028,7 +1901,6 @@ def get_supported_stack( :type build_service_name: str :param stack_name: The name of the stack resource. Required. :type stack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: SupportedStackResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: @@ -2049,23 +1921,22 @@ def get_supported_stack( ) cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) - request = build_get_supported_stack_request( + _request = build_get_supported_stack_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, stack_name=stack_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_supported_stack.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2077,10 +1948,6 @@ def get_supported_stack( deserialized = self._deserialize("SupportedStackResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_supported_stack.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_buildpack_binding_operations.py index 2fc145a2cd7..19820ecf720 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_buildpack_binding_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_buildpack_binding_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -262,7 +262,6 @@ def list_for_cluster( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -288,17 +287,16 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -309,14 +307,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -326,11 +324,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -342,10 +340,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" - } - @distributed_trace def get( self, @@ -369,7 +363,6 @@ def get( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: BuildpackBindingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -390,7 +383,7 @@ def get( ) cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -398,16 +391,15 @@ def get( buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -419,13 +411,9 @@ def get( deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -434,7 +422,7 @@ def _create_or_update_initial( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> _models.BuildpackBindingResource: error_map = { @@ -462,7 +450,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -473,16 +461,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -502,10 +489,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } - @overload def begin_create_or_update( self, @@ -539,14 +522,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -562,7 +537,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: IO, + buildpack_binding: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -582,18 +557,10 @@ def begin_create_or_update( :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Required. - :type buildpack_binding: IO + :type buildpack_binding: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 BuildpackBindingResource or the result of cls(response) :rtype: @@ -609,7 +576,7 @@ def begin_create_or_update( build_service_name: str, builder_name: str, buildpack_binding_name: str, - buildpack_binding: Union[_models.BuildpackBindingResource, IO], + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.BuildpackBindingResource]: """Create or update a buildpack binding. @@ -626,20 +593,9 @@ def begin_create_or_update( :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_name: str :param buildpack_binding: The target buildpack binding for the create or update operation. Is - either a BuildpackBindingResource type or a IO type. Required. + either a BuildpackBindingResource type or a IO[bytes] type. Required. :type buildpack_binding: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildpackBindingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.BuildpackBindingResource or IO[bytes] :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of cls(response) :rtype: @@ -677,7 +633,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -687,17 +643,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -724,7 +678,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, @@ -732,16 +686,15 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements buildpack_binding_name=buildpack_binding_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -751,11 +704,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -780,14 +729,6 @@ def begin_delete( :type builder_name: str :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. :type buildpack_binding_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: @@ -819,7 +760,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -828,17 +769,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -855,7 +792,6 @@ def list( :type build_service_name: str :param builder_name: The name of the builder resource. Required. :type builder_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BuildpackBindingResource or the result of cls(response) :rtype: @@ -881,19 +817,18 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, build_service_name=build_service_name, builder_name=builder_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -904,14 +839,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) @@ -921,11 +856,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -936,7 +871,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_certificates_operations.py index 18587cbd83f..bd636fc79e1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_certificates_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_certificates_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> _models.CertificateResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(certificate_resource, "CertificateResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } - @overload def begin_create_or_update( self, @@ -360,14 +349,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -381,7 +362,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: IO, + certificate_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -396,18 +377,10 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Required. - :type certificate_resource: IO + :type certificate_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CertificateResource or the result of cls(response) :rtype: @@ -421,7 +394,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, certificate_name: str, - certificate_resource: Union[_models.CertificateResource, IO], + certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CertificateResource]: """Create or update certificate resource. @@ -434,20 +407,9 @@ def begin_create_or_update( :param certificate_name: The name of the certificate resource. Required. :type certificate_name: str :param certificate_resource: Parameters for the create or update operation. Is either a - CertificateResource type or a IO type. Required. + CertificateResource type or a IO[bytes] type. Required. :type certificate_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.CertificateResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.CertificateResource or IO[bytes] :return: An instance of LROPoller that returns either CertificateResource or the result of cls(response) :rtype: @@ -483,7 +445,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CertificateResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -493,17 +455,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CertificateResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any @@ -524,22 +484,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -549,11 +508,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/certificates/{certificateName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -568,14 +523,6 @@ def begin_delete( :type service_name: str :param certificate_name: The name of the certificate resource. Required. :type certificate_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: @@ -605,7 +552,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -614,17 +561,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -637,7 +580,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.CertificateResource] @@ -662,17 +604,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -683,14 +624,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) @@ -700,11 +641,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -715,7 +656,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_config_servers_operations.py index 7dc36f837a2..47533f42aea 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_config_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_config_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -197,7 +197,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -218,21 +217,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,19 +242,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -284,7 +278,7 @@ def _update_put_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -292,16 +286,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +314,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_put( self, @@ -348,14 +337,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -368,7 +349,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -381,18 +362,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -405,7 +378,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -416,20 +389,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -464,7 +426,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -474,23 +436,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerResource: error_map = { @@ -518,7 +478,7 @@ def _update_patch_initial( else: _json = self._serialize.body(config_server_resource, "ConfigServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -526,16 +486,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,10 +514,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } - @overload def begin_update_patch( self, @@ -582,14 +537,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -602,7 +549,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: IO, + config_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -615,18 +562,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Required. - :type config_server_resource: IO + :type config_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerResource or the result of cls(response) :rtype: @@ -639,7 +578,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - config_server_resource: Union[_models.ConfigServerResource, IO], + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerResource]: """Update the config server. @@ -650,20 +589,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_resource: Parameters for the update operation. Is either a - ConfigServerResource type or a IO type. Required. + ConfigServerResource type or a IO[bytes] type. Required. :type config_server_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigServerResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerResource or the result of cls(response) :rtype: @@ -698,7 +626,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -708,23 +636,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default" - } + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_initial( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigServerSettingsValidateResult: error_map = { @@ -752,7 +678,7 @@ def _validate_initial( else: _json = self._serialize.body(config_server_settings, "ConfigServerSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -760,16 +686,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -789,10 +714,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } - @overload def begin_validate( self, @@ -816,14 +737,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -836,7 +749,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: IO, + config_server_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -849,18 +762,10 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Required. - :type config_server_settings: IO + :type config_server_settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -873,7 +778,7 @@ def begin_validate( self, resource_group_name: str, service_name: str, - config_server_settings: Union[_models.ConfigServerSettings, IO], + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: """Check if the config server settings are valid. @@ -884,20 +789,9 @@ def begin_validate( :param service_name: The name of the Service resource. Required. :type service_name: str :param config_server_settings: Config server settings to be validated. Is either a - ConfigServerSettings type or a IO type. Required. + ConfigServerSettings type or a IO[bytes] type. Required. :type config_server_settings: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigServerSettings or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigServerSettings or IO[bytes] :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the result of cls(response) :rtype: @@ -932,7 +826,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -944,14 +838,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate" - } + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_configuration_services_operations.py index 54f6a05b02f..26d4615c0c0 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_configuration_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_configuration_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -280,7 +280,6 @@ def get( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -301,22 +300,21 @@ def get( ) cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -328,20 +326,16 @@ def get( deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceResource: error_map = { @@ -369,7 +363,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -378,16 +372,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -407,10 +400,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } - @overload def begin_create_or_update( self, @@ -438,14 +427,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -459,7 +440,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -475,18 +456,10 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceResource or the result of cls(response) :rtype: @@ -500,7 +473,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceResource]: """Create the default Application Configuration Service or update the existing Application @@ -514,20 +487,9 @@ def begin_create_or_update( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Parameters for the update operation. Is either a - ConfigurationServiceResource type or a IO type. Required. + ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -563,7 +525,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -573,17 +535,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any @@ -604,22 +564,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -629,11 +588,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/configurationServices/{configurationServiceName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -648,14 +603,6 @@ def begin_delete( :type service_name: str :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_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: @@ -685,7 +632,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -694,17 +641,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -717,7 +660,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationServiceResource or the result of cls(response) :rtype: @@ -743,17 +685,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -764,14 +705,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) @@ -781,11 +722,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -797,16 +738,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices" - } - def _validate_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> _models.ConfigurationServiceSettingsValidateResult: error_map = { @@ -834,7 +771,7 @@ def _validate_initial( else: _json = self._serialize.body(settings, "ConfigurationServiceSettings") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -843,16 +780,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -872,10 +808,6 @@ def _validate_initial( return deserialized # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } - @overload def begin_validate( self, @@ -901,14 +833,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -922,7 +846,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: IO, + settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -937,18 +861,10 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Required. - :type settings: IO + :type settings: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -962,7 +878,7 @@ def begin_validate( resource_group_name: str, service_name: str, configuration_service_name: str, - settings: Union[_models.ConfigurationServiceSettings, IO], + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service settings are valid. @@ -975,20 +891,9 @@ def begin_validate( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param settings: Application Configuration Service settings to be validated. Is either a - ConfigurationServiceSettings type or a IO type. Required. + ConfigurationServiceSettings type or a IO[bytes] type. Required. :type settings: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigurationServiceSettings - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1024,7 +929,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1036,24 +941,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _validate_resource_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> Optional[_models.ConfigurationServiceSettingsValidateResult]: error_map = { @@ -1081,7 +984,7 @@ def _validate_resource_initial( else: _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") - request = build_validate_resource_request( + _request = build_validate_resource_request( resource_group_name=resource_group_name, service_name=service_name, configuration_service_name=configuration_service_name, @@ -1090,16 +993,15 @@ def _validate_resource_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_resource_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1117,13 +1019,9 @@ def _validate_resource_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - _validate_resource_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return deserialized # type: ignore @overload def begin_validate_resource( @@ -1152,14 +1050,6 @@ def begin_validate_resource( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1173,7 +1063,7 @@ def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: IO, + configuration_service_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1189,18 +1079,10 @@ def begin_validate_resource( :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be validated. Required. - :type configuration_service_resource: IO + :type configuration_service_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1214,7 +1096,7 @@ def begin_validate_resource( resource_group_name: str, service_name: str, configuration_service_name: str, - configuration_service_resource: Union[_models.ConfigurationServiceResource, IO], + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: """Check if the Application Configuration Service resource is valid. @@ -1227,20 +1109,9 @@ def begin_validate_resource( :param configuration_service_name: The name of Application Configuration Service. Required. :type configuration_service_name: str :param configuration_service_resource: Application Configuration Service resource to be - validated. Is either a ConfigurationServiceResource type or a IO type. Required. + validated. Is either a ConfigurationServiceResource type or a IO[bytes] type. Required. :type configuration_service_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigurationServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ConfigurationServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ConfigurationServiceSettingsValidateResult or the result of cls(response) :rtype: @@ -1276,7 +1147,7 @@ def begin_validate_resource( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1288,14 +1159,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_resource.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" - } + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_container_registries_operations.py index 361b26b49dc..06d7c82fa28 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_container_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_container_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -241,7 +241,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContainerRegistryResource or the result of cls(response) :rtype: @@ -267,17 +266,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -288,14 +286,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) @@ -305,11 +303,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -321,10 +319,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -338,7 +332,6 @@ def get( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ContainerRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -359,22 +352,21 @@ def get( ) cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -386,20 +378,16 @@ def get( deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> _models.ContainerRegistryResource: error_map = { @@ -427,7 +415,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -436,16 +424,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -465,10 +452,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } - @overload def begin_create_or_update( self, @@ -495,14 +478,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -516,7 +491,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: IO, + container_registry_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -531,18 +506,10 @@ def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Required. - :type container_registry_resource: IO + :type container_registry_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryResource or the result of cls(response) :rtype: @@ -556,7 +523,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_resource: Union[_models.ContainerRegistryResource, IO], + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ContainerRegistryResource]: """Create or update container registry resource. @@ -569,20 +536,9 @@ def begin_create_or_update( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_resource: Parameters for the create or update operation. Is either a - ContainerRegistryResource type or a IO type. Required. + ContainerRegistryResource type or a IO[bytes] type. Required. :type container_registry_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ContainerRegistryResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ContainerRegistryResource or IO[bytes] :return: An instance of LROPoller that returns either ContainerRegistryResource or the result of cls(response) :rtype: @@ -618,7 +574,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -630,17 +586,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ContainerRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return LROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any @@ -661,22 +615,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -690,11 +643,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -709,14 +658,6 @@ def begin_delete( :type service_name: str :param container_registry_name: The name of the container registry. Required. :type container_registry_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: @@ -746,7 +687,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -757,24 +698,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _validate_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.ContainerRegistryValidateResult]: error_map = { @@ -802,7 +739,7 @@ def _validate_initial( else: _json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, container_registry_name=container_registry_name, @@ -811,16 +748,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -838,13 +774,9 @@ def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return deserialized # type: ignore @overload def begin_validate( @@ -872,14 +804,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -893,7 +817,7 @@ def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: IO, + container_registry_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -908,18 +832,10 @@ def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Required. - :type container_registry_properties: IO + :type container_registry_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -933,7 +849,7 @@ def begin_validate( resource_group_name: str, service_name: str, container_registry_name: str, - container_registry_properties: Union[_models.ContainerRegistryProperties, IO], + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ContainerRegistryValidateResult]: """Check if the container registry properties are valid. @@ -946,20 +862,9 @@ def begin_validate( :param container_registry_name: The name of the container registry. Required. :type container_registry_name: str :param container_registry_properties: Parameters for the validate operation. Is either a - ContainerRegistryProperties type or a IO type. Required. + ContainerRegistryProperties type or a IO[bytes] type. Required. :type container_registry_properties: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.ContainerRegistryProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.ContainerRegistryProperties or IO[bytes] :return: An instance of LROPoller that returns either ContainerRegistryValidateResult or the result of cls(response) :rtype: @@ -995,7 +900,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1007,14 +912,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ContainerRegistryValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" - } + return LROPoller[_models.ContainerRegistryValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_custom_domains_operations.py index fc04ce6bd41..b8f534c00d9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -244,7 +244,6 @@ def get( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -265,23 +264,22 @@ def get( ) cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,13 +291,9 @@ def get( deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -307,7 +301,7 @@ def _create_or_update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -335,7 +329,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -345,16 +339,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,10 +370,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -409,14 +398,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -431,7 +412,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -448,18 +429,10 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -474,7 +447,7 @@ def begin_create_or_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Create or update custom domain of one lifecycle application. @@ -489,20 +462,9 @@ def begin_create_or_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -539,7 +501,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -549,17 +511,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any @@ -580,23 +540,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,11 +565,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -627,14 +582,6 @@ def begin_delete( :type app_name: str :param domain_name: The name of the custom domain resource. Required. :type domain_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: @@ -665,7 +612,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -674,17 +621,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -692,7 +635,7 @@ def _update_initial( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainResource: error_map = { @@ -720,7 +663,7 @@ def _update_initial( else: _json = self._serialize.body(domain_resource, "CustomDomainResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -730,16 +673,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -759,10 +701,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } - @overload def begin_update( self, @@ -791,14 +729,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -813,7 +743,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: IO, + domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -830,18 +760,10 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Required. - :type domain_resource: IO + :type domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomDomainResource or the result of cls(response) :rtype: @@ -856,7 +778,7 @@ def begin_update( service_name: str, app_name: str, domain_name: str, - domain_resource: Union[_models.CustomDomainResource, IO], + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomDomainResource]: """Update custom domain of one lifecycle application. @@ -871,20 +793,9 @@ def begin_update( :param domain_name: The name of the custom domain resource. Required. :type domain_name: str :param domain_resource: Parameters for the create or update operation. Is either a - CustomDomainResource type or a IO type. Required. + CustomDomainResource type or a IO[bytes] type. Required. :type domain_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either CustomDomainResource or the result of cls(response) :rtype: @@ -921,7 +832,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -931,17 +842,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}" - } + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -956,7 +865,6 @@ def list( :type service_name: str :param app_name: The name of the App resource. Required. :type app_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomDomainResource or the result of cls(response) :rtype: @@ -982,18 +890,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1004,14 +911,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) @@ -1021,11 +928,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,7 +943,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_customized_accelerators_operations.py index 25ed1742c59..c34281eb1be 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_customized_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_customized_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -280,7 +280,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -306,18 +305,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -328,14 +326,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) @@ -345,11 +343,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -361,10 +359,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" - } - @distributed_trace def get( self, @@ -385,7 +379,6 @@ def get( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomizedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -406,23 +399,22 @@ def get( ) cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,13 +426,9 @@ def get( deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -448,7 +436,7 @@ def _create_or_update_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> _models.CustomizedAcceleratorResource: error_map = { @@ -476,7 +464,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -486,16 +474,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -515,10 +502,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } - @overload def begin_create_or_update( self, @@ -549,14 +532,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -571,7 +546,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: IO, + customized_accelerator_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -589,18 +564,10 @@ def begin_create_or_update( :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update operation. Required. - :type customized_accelerator_resource: IO + :type customized_accelerator_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -615,7 +582,7 @@ def begin_create_or_update( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO], + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomizedAcceleratorResource]: """Create or update the customized accelerator. @@ -630,20 +597,9 @@ def begin_create_or_update( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param customized_accelerator_resource: The customized accelerator for the create or update - operation. Is either a CustomizedAcceleratorResource type or a IO type. Required. + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. :type customized_accelerator_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomizedAcceleratorResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomizedAcceleratorResource or IO[bytes] :return: An instance of LROPoller that returns either CustomizedAcceleratorResource or the result of cls(response) :rtype: @@ -680,7 +636,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -690,17 +646,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -726,23 +680,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, customized_accelerator_name=customized_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -756,11 +709,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -782,14 +731,6 @@ def begin_delete( :type application_accelerator_name: str :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_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: @@ -820,7 +761,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -829,17 +770,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _validate_initial( self, @@ -847,7 +784,7 @@ def _validate_initial( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Optional[_models.CustomizedAcceleratorValidateResult]: error_map = { @@ -875,7 +812,7 @@ def _validate_initial( else: _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") - request = build_validate_request( + _request = build_validate_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, @@ -885,16 +822,15 @@ def _validate_initial( content_type=content_type, json=_json, content=_content, - template_url=self._validate_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -912,13 +848,9 @@ def _validate_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _validate_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return deserialized # type: ignore @overload def begin_validate( @@ -949,14 +881,6 @@ def begin_validate( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorValidateResult or the result of cls(response) :rtype: @@ -971,7 +895,7 @@ def begin_validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: IO, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -988,18 +912,10 @@ def begin_validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Required. - :type properties: IO + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 CustomizedAcceleratorValidateResult or the result of cls(response) :rtype: @@ -1014,7 +930,7 @@ def begin_validate( service_name: str, application_accelerator_name: str, customized_accelerator_name: str, - properties: Union[_models.CustomizedAcceleratorProperties, IO], + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CustomizedAcceleratorValidateResult]: """Check the customized accelerator are valid. @@ -1029,20 +945,9 @@ def begin_validate( :param customized_accelerator_name: The name of the customized accelerator. Required. :type customized_accelerator_name: str :param properties: Customized accelerator properties to be validated. Is either a - CustomizedAcceleratorProperties type or a IO type. Required. + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. :type properties: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomizedAcceleratorProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] :return: An instance of LROPoller that returns either CustomizedAcceleratorValidateResult or the result of cls(response) :rtype: @@ -1079,7 +984,7 @@ def begin_validate( def get_long_running_output(pipeline_response): deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1089,14 +994,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.CustomizedAcceleratorValidateResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate" - } + return LROPoller[_models.CustomizedAcceleratorValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_deployments_operations.py index e8d2914e6b6..cdf6072e5a9 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_deployments_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_deployments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -474,7 +474,7 @@ def build_disable_remote_debugging_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_remote_debugging_config_request( +def build_get_remote_debugging_config_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, app_name: str, @@ -708,7 +708,6 @@ def get( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: @@ -729,23 +728,22 @@ def get( ) cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -757,13 +755,9 @@ def get( deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -771,7 +765,7 @@ def _create_or_update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -799,7 +793,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -809,16 +803,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -841,10 +834,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_create_or_update( self, @@ -874,14 +863,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -896,7 +877,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -913,18 +894,10 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -939,7 +912,7 @@ def begin_create_or_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Create a new Deployment or update an exiting Deployment. @@ -954,20 +927,9 @@ def begin_create_or_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the create or update operation. Is either a - DeploymentResource type or a IO type. Required. + DeploymentResource type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1004,7 +966,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1014,17 +976,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1045,23 +1005,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1071,11 +1030,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/apps/{appName}/deployments/{deploymentName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -1092,14 +1047,6 @@ def begin_delete( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1130,7 +1077,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1139,17 +1086,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( self, @@ -1157,7 +1100,7 @@ def _update_initial( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> _models.DeploymentResource: error_map = { @@ -1185,7 +1128,7 @@ def _update_initial( else: _json = self._serialize.body(deployment_resource, "DeploymentResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1195,16 +1138,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1224,10 +1166,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } - @overload def begin_update( self, @@ -1257,14 +1195,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1279,7 +1209,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: IO, + deployment_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1296,18 +1226,10 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Required. - :type deployment_resource: IO + :type deployment_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DeploymentResource or the result of cls(response) :rtype: @@ -1322,7 +1244,7 @@ def begin_update( service_name: str, app_name: str, deployment_name: str, - deployment_resource: Union[_models.DeploymentResource, IO], + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DeploymentResource]: """Operation to update an exiting Deployment. @@ -1337,20 +1259,9 @@ def begin_update( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource - type or a IO type. Required. + type or a IO[bytes] type. Required. :type deployment_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentResource or IO[bytes] :return: An instance of LROPoller that returns either DeploymentResource or the result of cls(response) :rtype: @@ -1387,7 +1298,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DeploymentResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1397,17 +1308,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DeploymentResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}" - } + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list( @@ -1432,7 +1341,6 @@ def list( :type version: list[str] :param expand: The expand expression to apply on the operation. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentResource] @@ -1457,7 +1365,7 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -1465,12 +1373,11 @@ def prepare_request(next_link=None): version=version, expand=expand, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1481,14 +1388,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1498,11 +1405,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1514,10 +1421,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments" - } - @distributed_trace def list_for_cluster( self, @@ -1538,7 +1441,6 @@ def list_for_cluster( :type version: list[str] :param expand: The expand expression to apply on the operation. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.DeploymentResource] @@ -1563,19 +1465,18 @@ def list_for_cluster( def prepare_request(next_link=None): if not next_link: - request = build_list_for_cluster_request( + _request = build_list_for_cluster_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, version=version, expand=expand, api_version=api_version, - template_url=self.list_for_cluster.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1586,14 +1487,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) @@ -1603,11 +1504,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1619,10 +1520,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_for_cluster.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments" - } - def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> None: @@ -1642,23 +1539,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1668,11 +1564,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start( @@ -1689,14 +1581,6 @@ def begin_start( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1727,7 +1611,7 @@ def begin_start( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1736,17 +1620,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1767,23 +1647,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1793,11 +1672,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop( @@ -1814,14 +1689,6 @@ def begin_stop( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1852,7 +1719,7 @@ def begin_stop( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1861,17 +1728,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -1892,23 +1755,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1918,11 +1780,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_restart( @@ -1939,14 +1797,6 @@ def begin_restart( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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: @@ -1977,7 +1827,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1986,17 +1836,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_remote_debugging_initial( self, @@ -2004,7 +1850,7 @@ def _enable_remote_debugging_initial( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> _models.RemoteDebugging: error_map = { @@ -2035,7 +1881,7 @@ def _enable_remote_debugging_initial( else: _json = None - request = build_enable_remote_debugging_request( + _request = build_enable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2045,16 +1891,15 @@ def _enable_remote_debugging_initial( content_type=content_type, json=_json, content=_content, - template_url=self._enable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2074,10 +1919,6 @@ def _enable_remote_debugging_initial( return deserialized # type: ignore - _enable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } - @overload def begin_enable_remote_debugging( self, @@ -2107,14 +1948,6 @@ def begin_enable_remote_debugging( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2129,7 +1962,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[IO] = None, + remote_debugging_payload: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2146,18 +1979,10 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. - :type remote_debugging_payload: IO + :type remote_debugging_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 RemoteDebugging or the result of cls(response) :rtype: @@ -2172,7 +1997,7 @@ def begin_enable_remote_debugging( service_name: str, app_name: str, deployment_name: str, - remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO]] = None, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> LROPoller[_models.RemoteDebugging]: """Enable remote debugging. @@ -2187,20 +2012,9 @@ def begin_enable_remote_debugging( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param remote_debugging_payload: Parameters for enable remote debugging. Is either a - RemoteDebuggingPayload type or a IO type. Default value is None. + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. :type remote_debugging_payload: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.RemoteDebuggingPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.RemoteDebuggingPayload or IO[bytes] :return: An instance of LROPoller that returns either RemoteDebugging or the result of cls(response) :rtype: @@ -2237,7 +2051,7 @@ def begin_enable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2247,17 +2061,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2278,23 +2090,22 @@ def _disable_remote_debugging_initial( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_disable_remote_debugging_request( + _request = build_disable_remote_debugging_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_remote_debugging_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2314,10 +2125,6 @@ def _disable_remote_debugging_initial( return deserialized # type: ignore - _disable_remote_debugging_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } - @distributed_trace def begin_disable_remote_debugging( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any @@ -2333,14 +2140,6 @@ def begin_disable_remote_debugging( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_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 RemoteDebugging or the result of cls(response) :rtype: @@ -2374,7 +2173,7 @@ def begin_disable_remote_debugging( def get_long_running_output(pipeline_response): deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2384,17 +2183,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.RemoteDebugging].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_remote_debugging.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" - } + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def get_remote_debugging_config( @@ -2411,7 +2208,6 @@ def get_remote_debugging_config( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: RemoteDebugging or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: @@ -2432,23 +2228,22 @@ def get_remote_debugging_config( ) cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) - request = build_get_remote_debugging_config_request( + _request = build_get_remote_debugging_config_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_remote_debugging_config.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2460,13 +2255,9 @@ def get_remote_debugging_config( deserialized = self._deserialize("RemoteDebugging", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_remote_debugging_config.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" - } + return deserialized # type: ignore @distributed_trace def get_log_file_url( @@ -2483,7 +2274,6 @@ def get_log_file_url( :type app_name: str :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: LogFileUrlResponse or None or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: @@ -2504,23 +2294,22 @@ def get_log_file_url( ) cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) - request = build_get_log_file_url_request( + _request = build_get_log_file_url_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_log_file_url.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2534,13 +2323,9 @@ def get_log_file_url( deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_log_file_url.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl" - } + return deserialized # type: ignore def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2548,7 +2333,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2576,7 +2361,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_heap_dump_request( + _request = build_generate_heap_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2586,16 +2371,15 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, content=_content, - template_url=self._generate_heap_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2605,11 +2389,7 @@ def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statemen raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_heap_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_heap_dump( @@ -2640,14 +2420,6 @@ def begin_generate_heap_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2660,7 +2432,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2677,18 +2449,10 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2701,7 +2465,7 @@ def begin_generate_heap_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Heap Dump. @@ -2716,20 +2480,9 @@ def begin_generate_heap_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -2763,7 +2516,7 @@ def begin_generate_heap_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2772,17 +2525,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_heap_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements self, @@ -2790,7 +2539,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -2818,7 +2567,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_generate_thread_dump_request( + _request = build_generate_thread_dump_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -2828,16 +2577,15 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._generate_thread_dump_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2847,11 +2595,7 @@ def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statem raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _generate_thread_dump_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_generate_thread_dump( @@ -2882,14 +2626,6 @@ def begin_generate_thread_dump( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2902,7 +2638,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2919,18 +2655,10 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2943,7 +2671,7 @@ def begin_generate_thread_dump( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Generate Thread Dump. @@ -2958,20 +2686,9 @@ def begin_generate_thread_dump( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -3005,7 +2722,7 @@ def begin_generate_thread_dump( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3014,17 +2731,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_generate_thread_dump.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_jfr_initial( # pylint: disable=inconsistent-return-statements self, @@ -3032,7 +2745,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> None: error_map = { @@ -3060,7 +2773,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements else: _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") - request = build_start_jfr_request( + _request = build_start_jfr_request( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, @@ -3070,16 +2783,15 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self._start_jfr_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -3089,11 +2801,7 @@ def _start_jfr_initial( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_jfr_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return cls(pipeline_response, None, {}) # type: ignore @overload def begin_start_jfr( @@ -3124,14 +2832,6 @@ def begin_start_jfr( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -3144,7 +2844,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: IO, + diagnostic_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -3161,18 +2861,10 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Required. - :type diagnostic_parameters: IO + :type diagnostic_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -3185,7 +2877,7 @@ def begin_start_jfr( service_name: str, app_name: str, deployment_name: str, - diagnostic_parameters: Union[_models.DiagnosticParameters, IO], + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Start JFR. @@ -3200,20 +2892,9 @@ def begin_start_jfr( :param deployment_name: The name of the Deployment resource. Required. :type deployment_name: str :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a - DiagnosticParameters type or a IO type. Required. + DiagnosticParameters type or a IO[bytes] type. Required. :type diagnostic_parameters: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.DiagnosticParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.DiagnosticParameters or IO[bytes] :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: @@ -3247,7 +2928,7 @@ def begin_start_jfr( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3256,14 +2937,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start_jfr.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_dev_tool_portals_operations.py index de9453eba20..4d13d675a8e 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_dev_tool_portals_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_dev_tool_portals_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -204,7 +204,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DevToolPortalResource or the result of cls(response) :rtype: @@ -230,17 +229,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -251,14 +249,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) @@ -268,11 +266,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -284,10 +282,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/devToolPortals" - } - @distributed_trace def get( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -301,7 +295,6 @@ def get( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: DevToolPortalResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: @@ -322,22 +315,21 @@ def get( ) cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,20 +341,16 @@ def get( deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> _models.DevToolPortalResource: error_map = { @@ -390,7 +378,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, @@ -399,16 +387,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -428,10 +415,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } - @overload def begin_create_or_update( self, @@ -458,14 +441,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -479,7 +454,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: IO, + dev_tool_portal_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -494,18 +469,10 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Required. - :type dev_tool_portal_resource: IO + :type dev_tool_portal_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 DevToolPortalResource or the result of cls(response) :rtype: @@ -519,7 +486,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, dev_tool_portal_name: str, - dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO], + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.DevToolPortalResource]: """Create the default Dev Tool Portal or update the existing Dev Tool Portal. @@ -532,20 +499,9 @@ def begin_create_or_update( :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_name: str :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a - DevToolPortalResource type or a IO type. Required. + DevToolPortalResource type or a IO[bytes] type. Required. :type dev_tool_portal_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.DevToolPortalResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.DevToolPortalResource or IO[bytes] :return: An instance of LROPoller that returns either DevToolPortalResource or the result of cls(response) :rtype: @@ -581,7 +537,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("DevToolPortalResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -591,17 +547,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.DevToolPortalResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any @@ -622,22 +576,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, dev_tool_portal_name=dev_tool_portal_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -651,11 +604,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_delete( @@ -670,14 +619,6 @@ def begin_delete( :type service_name: str :param dev_tool_portal_name: The name of Dev Tool Portal. Required. :type dev_tool_portal_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: @@ -707,7 +648,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -716,14 +657,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_eureka_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_eureka_servers_operations.py index d19a19e0be3..0112495ce47 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_eureka_servers_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_eureka_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -194,7 +194,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResourceCollection or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.EurekaServerResourceCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -215,21 +214,20 @@ def list( ) cls: ClsType[_models.EurekaServerResourceCollection] = kwargs.pop("cls", None) - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -241,13 +239,9 @@ def list( deserialized = self._deserialize("EurekaServerResourceCollection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers" - } + return deserialized # type: ignore @distributed_trace def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.EurekaServerResource: @@ -258,7 +252,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: EurekaServerResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.EurekaServerResource :raises ~azure.core.exceptions.HttpResponseError: @@ -279,21 +272,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -305,19 +297,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -345,7 +333,7 @@ def _update_put_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -353,16 +341,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -385,10 +372,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload def begin_update_put( self, @@ -412,14 +395,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -432,7 +407,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -445,18 +420,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -469,7 +436,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -480,20 +447,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of LROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -528,7 +484,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -540,23 +496,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return LROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> _models.EurekaServerResource: error_map = { @@ -584,7 +538,7 @@ def _update_patch_initial( else: _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -592,16 +546,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -624,10 +577,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } - @overload def begin_update_patch( self, @@ -651,14 +600,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -671,7 +612,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: IO, + eureka_server_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -684,18 +625,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Required. - :type eureka_server_resource: IO + :type eureka_server_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 EurekaServerResource or the result of cls(response) :rtype: @@ -708,7 +641,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - eureka_server_resource: Union[_models.EurekaServerResource, IO], + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.EurekaServerResource]: """Update the eureka server settings. @@ -719,20 +652,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param eureka_server_resource: Parameters for the update operation. Is either a - EurekaServerResource type or a IO type. Required. + EurekaServerResource type or a IO[bytes] type. Required. :type eureka_server_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.EurekaServerResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.EurekaServerResource or IO[bytes] :return: An instance of LROPoller that returns either EurekaServerResource or the result of cls(response) :rtype: @@ -767,7 +689,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("EurekaServerResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -779,14 +701,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.EurekaServerResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" - } + return LROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_gateway_custom_domains_operations.py index 897bb3b5440..4bbd5dce114 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_gateway_custom_domains_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_gateway_custom_domains_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCustomDomainResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayCustomDomainResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } - @overload def begin_create_or_update( self, @@ -387,14 +376,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -409,7 +390,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: IO, + gateway_custom_domain_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -427,18 +408,10 @@ def begin_create_or_update( :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or update operation. Required. - :type gateway_custom_domain_resource: IO + :type gateway_custom_domain_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -453,7 +426,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, domain_name: str, - gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO], + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayCustomDomainResource]: """Create or update the Spring Cloud Gateway custom domain. @@ -468,20 +441,9 @@ def begin_create_or_update( :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_name: str :param gateway_custom_domain_resource: The gateway custom domain resource for the create or - update operation. Is either a GatewayCustomDomainResource type or a IO type. Required. + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. :type gateway_custom_domain_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayCustomDomainResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayCustomDomainResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -518,7 +480,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -528,17 +490,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any @@ -559,23 +519,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, domain_name=domain_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,11 +544,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/domains/{domainName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -606,14 +561,6 @@ def begin_delete( :type gateway_name: str :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. :type domain_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: @@ -644,7 +591,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -653,17 +600,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -678,7 +621,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCustomDomainResource or the result of cls(response) :rtype: @@ -704,18 +646,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -726,14 +667,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) @@ -743,11 +684,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -758,7 +699,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_gateway_route_configs_operations.py index 8fc5c9a8e41..d4ede3e21d1 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_gateway_route_configs_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_gateway_route_configs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -223,7 +223,6 @@ def get( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayRouteConfigResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: @@ -244,23 +243,22 @@ def get( ) cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,13 +270,9 @@ def get( deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, @@ -286,7 +280,7 @@ def _create_or_update_initial( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayRouteConfigResource: error_map = { @@ -314,7 +308,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -324,16 +318,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,10 +346,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } - @overload def begin_create_or_update( self, @@ -388,14 +377,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -410,7 +391,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: IO, + gateway_route_config_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -429,18 +410,10 @@ def begin_create_or_update( :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or update operation. Required. - :type gateway_route_config_resource: IO + :type gateway_route_config_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -455,7 +428,7 @@ def begin_create_or_update( service_name: str, gateway_name: str, route_config_name: str, - gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO], + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayRouteConfigResource]: """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud @@ -471,20 +444,9 @@ def begin_create_or_update( :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_name: str :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or - update operation. Is either a GatewayRouteConfigResource type or a IO type. Required. + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. :type gateway_route_config_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayRouteConfigResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayRouteConfigResource or IO[bytes] :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -521,7 +483,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -531,17 +493,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any @@ -562,23 +522,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, route_config_name=route_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,11 +547,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -609,14 +564,6 @@ def begin_delete( :type gateway_name: str :param route_config_name: The name of the Spring Cloud Gateway route config. Required. :type route_config_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: @@ -647,7 +594,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -656,17 +603,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -681,7 +624,6 @@ def list( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayRouteConfigResource or the result of cls(response) :rtype: @@ -707,18 +649,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -729,14 +670,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) @@ -746,11 +687,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -761,7 +702,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_gateways_operations.py index d0fbe00da5d..e742ee1581b 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_gateways_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_gateways_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -334,7 +334,6 @@ def get( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: @@ -355,22 +354,21 @@ def get( ) cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -382,20 +380,16 @@ def get( deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> _models.GatewayResource: error_map = { @@ -423,7 +417,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(gateway_resource, "GatewayResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -432,16 +426,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -461,10 +454,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } - @overload def begin_create_or_update( self, @@ -490,14 +479,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -511,7 +492,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: IO, + gateway_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -526,18 +507,10 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Required. - :type gateway_resource: IO + :type gateway_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -551,7 +524,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, gateway_name: str, - gateway_resource: Union[_models.GatewayResource, IO], + gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. @@ -564,20 +537,9 @@ def begin_create_or_update( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_resource: The gateway for the create or update operation. Is either a - GatewayResource type or a IO type. Required. + GatewayResource type or a IO[bytes] type. Required. :type gateway_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -613,7 +575,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -623,24 +585,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_capacity_initial( self, resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> Optional[_models.GatewayResource]: error_map = { @@ -668,7 +628,7 @@ def _update_capacity_initial( else: _json = self._serialize.body(gateway_capacity_resource, "SkuObject") - request = build_update_capacity_request( + _request = build_update_capacity_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -677,16 +637,15 @@ def _update_capacity_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_capacity_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -704,13 +663,9 @@ def _update_capacity_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized + return cls(pipeline_response, deserialized, response_headers) # type: ignore - _update_capacity_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return deserialized # type: ignore @overload def begin_update_capacity( @@ -737,14 +692,6 @@ def begin_update_capacity( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -758,7 +705,7 @@ def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: IO, + gateway_capacity_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -773,18 +720,10 @@ def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Required. - :type gateway_capacity_resource: IO + :type gateway_capacity_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 GatewayResource or the result of cls(response) :rtype: @@ -798,7 +737,7 @@ def begin_update_capacity( resource_group_name: str, service_name: str, gateway_name: str, - gateway_capacity_resource: Union[_models.SkuObject, IO], + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.GatewayResource]: """Operation to update an exiting Spring Cloud Gateway capacity. @@ -811,20 +750,9 @@ def begin_update_capacity( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a - SkuObject type or a IO type. Required. + SkuObject type or a IO[bytes] type. Required. :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.SkuObject - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + or IO[bytes] :return: An instance of LROPoller that returns either GatewayResource or the result of cls(response) :rtype: @@ -860,7 +788,7 @@ def begin_update_capacity( def get_long_running_output(pipeline_response): deserialized = self._deserialize("GatewayResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -872,17 +800,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.GatewayResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_capacity.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -903,22 +829,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -928,11 +853,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/gateways/{gatewayName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -947,14 +868,6 @@ def begin_delete( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -984,7 +897,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -993,17 +906,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_env_secrets( @@ -1018,7 +927,6 @@ def list_env_secrets( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: dict mapping str to str or the result of cls(response) :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: @@ -1039,22 +947,21 @@ def list_env_secrets( ) cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) - request = build_list_env_secrets_request( + _request = build_list_env_secrets_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_env_secrets.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1066,13 +973,9 @@ def list_env_secrets( deserialized = self._deserialize("{str}", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_env_secrets.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" - } + return deserialized # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any @@ -1093,22 +996,21 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_restart_request( + _request = build_restart_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._restart_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1122,11 +1024,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _restart_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_restart( @@ -1141,14 +1039,6 @@ def begin_restart( :type service_name: str :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_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: @@ -1178,7 +1068,7 @@ def begin_restart( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1189,17 +1079,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_restart.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: @@ -1210,7 +1096,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.GatewayResource] @@ -1235,17 +1120,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1256,14 +1140,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) @@ -1273,11 +1157,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1289,10 +1173,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" - } - @overload def validate_domain( self, @@ -1319,7 +1199,6 @@ def validate_domain( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1331,7 +1210,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: IO, + validate_payload: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1346,11 +1225,10 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Required. - :type validate_payload: IO + :type validate_payload: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1362,7 +1240,7 @@ def validate_domain( resource_group_name: str, service_name: str, gateway_name: str, - validate_payload: Union[_models.CustomDomainValidatePayload, IO], + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], **kwargs: Any ) -> _models.CustomDomainValidateResult: """Check the domains are valid as well as not in use. @@ -1375,13 +1253,9 @@ def validate_domain( :param gateway_name: The name of Spring Cloud Gateway. Required. :type gateway_name: str :param validate_payload: Custom domain payload to be validated. Is either a - CustomDomainValidatePayload type or a IO type. Required. + CustomDomainValidatePayload type or a IO[bytes] type. Required. :type validate_payload: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidatePayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidatePayload or IO[bytes] :return: CustomDomainValidateResult or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1411,7 +1285,7 @@ def validate_domain( else: _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") - request = build_validate_domain_request( + _request = build_validate_domain_request( resource_group_name=resource_group_name, service_name=service_name, gateway_name=gateway_name, @@ -1420,16 +1294,15 @@ def validate_domain( content_type=content_type, json=_json, content=_content, - template_url=self.validate_domain.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1441,10 +1314,6 @@ def validate_domain( deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - validate_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" - } + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_monitoring_settings_operations.py index 6a33e8dca51..e5b9af09af7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_monitoring_settings_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_monitoring_settings_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -163,7 +163,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringSettingResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: @@ -184,21 +183,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -210,19 +208,15 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return deserialized # type: ignore def _update_put_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -250,7 +244,7 @@ def _update_put_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_put_request( + _request = build_update_put_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -258,16 +252,15 @@ def _update_put_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_put_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -287,10 +280,6 @@ def _update_put_initial( return deserialized # type: ignore - _update_put_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_put( self, @@ -314,14 +303,6 @@ def begin_update_put( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -334,7 +315,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -347,18 +328,10 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -371,7 +344,7 @@ def begin_update_put( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -382,20 +355,9 @@ def begin_update_put( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -430,7 +392,7 @@ def begin_update_put( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -440,23 +402,21 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_put.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _update_patch_initial( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> _models.MonitoringSettingResource: error_map = { @@ -484,7 +444,7 @@ def _update_patch_initial( else: _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") - request = build_update_patch_request( + _request = build_update_patch_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -492,16 +452,15 @@ def _update_patch_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_patch_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -521,10 +480,6 @@ def _update_patch_initial( return deserialized # type: ignore - _update_patch_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } - @overload def begin_update_patch( self, @@ -548,14 +503,6 @@ def begin_update_patch( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -568,7 +515,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: IO, + monitoring_setting_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -581,18 +528,10 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Required. - :type monitoring_setting_resource: IO + :type monitoring_setting_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 MonitoringSettingResource or the result of cls(response) :rtype: @@ -605,7 +544,7 @@ def begin_update_patch( self, resource_group_name: str, service_name: str, - monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO], + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.MonitoringSettingResource]: """Update the Monitoring Setting. @@ -616,20 +555,9 @@ def begin_update_patch( :param service_name: The name of the Service resource. Required. :type service_name: str :param monitoring_setting_resource: Parameters for the update operation. Is either a - MonitoringSettingResource type or a IO type. Required. + MonitoringSettingResource type or a IO[bytes] type. Required. :type monitoring_setting_resource: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.MonitoringSettingResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + ~azure.mgmt.appplatform.v2024_01_01_preview.models.MonitoringSettingResource or IO[bytes] :return: An instance of LROPoller that returns either MonitoringSettingResource or the result of cls(response) :rtype: @@ -664,7 +592,7 @@ def begin_update_patch( def get_long_running_output(pipeline_response): deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -674,14 +602,12 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_patch.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default" - } + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_operations.py index 58f545cefa5..7b82ff03ca2 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -79,7 +79,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDetail or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.OperationDetail] @@ -104,14 +103,13 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -122,14 +120,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AvailableOperations", pipeline_response) @@ -139,11 +137,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,5 +152,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.AppPlatform/operations"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_predefined_accelerators_operations.py index e725ce333cb..0bfc95ec22d 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_predefined_accelerators_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_predefined_accelerators_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -231,7 +231,6 @@ def list( :type service_name: str :param application_accelerator_name: The name of the application accelerator. Required. :type application_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PredefinedAcceleratorResource or the result of cls(response) :rtype: @@ -257,18 +256,17 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -279,14 +277,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) @@ -296,11 +294,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -312,10 +310,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" - } - @distributed_trace def get( self, @@ -336,7 +330,6 @@ def get( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: PredefinedAcceleratorResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: @@ -357,23 +350,22 @@ def get( ) cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -385,13 +377,9 @@ def get( deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" - } + return deserialized # type: ignore def _disable_initial( # pylint: disable=inconsistent-return-statements self, @@ -417,23 +405,22 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_request( + _request = build_disable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._disable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -447,11 +434,7 @@ def _disable_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_disable( @@ -473,14 +456,6 @@ def begin_disable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -511,7 +486,7 @@ def begin_disable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -520,17 +495,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _enable_initial( # pylint: disable=inconsistent-return-statements self, @@ -556,23 +527,22 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_enable_request( + _request = build_enable_request( resource_group_name=resource_group_name, service_name=service_name, application_accelerator_name=application_accelerator_name, predefined_accelerator_name=predefined_accelerator_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._enable_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -586,11 +556,7 @@ def _enable_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_enable( @@ -612,14 +578,6 @@ def begin_enable( :type application_accelerator_name: str :param predefined_accelerator_name: The name of the predefined accelerator. Required. :type predefined_accelerator_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: @@ -650,7 +608,7 @@ def begin_enable( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -659,14 +617,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_runtime_versions_operations.py index fce38998ecd..1cdd6180643 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_runtime_versions_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_runtime_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -77,7 +77,6 @@ def __init__(self, *args, **kwargs): def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: AvailableRuntimeVersions or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: @@ -98,18 +97,17 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio ) cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) - request = build_list_runtime_versions_request( + _request = build_list_runtime_versions_request( api_version=api_version, - template_url=self.list_runtime_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -121,8 +119,6 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - list_runtime_versions.metadata = {"url": "/providers/Microsoft.AppPlatform/runtimeVersions"} + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_service_registries_operations.py index 35a0e0e5218..f5ad94d86c7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_service_registries_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_service_registries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -196,7 +196,6 @@ def get( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceRegistryResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: @@ -217,22 +216,21 @@ def get( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -244,13 +242,9 @@ def get( deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -271,22 +265,21 @@ def _create_or_update_initial( ) cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -306,10 +299,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } - @distributed_trace def begin_create_or_update( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -323,14 +312,6 @@ def begin_create_or_update( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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 ServiceRegistryResource or the result of cls(response) :rtype: @@ -363,7 +344,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -373,17 +354,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any @@ -404,22 +383,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, service_registry_name=service_registry_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -429,11 +407,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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/{serviceRegistryName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -448,14 +422,6 @@ def begin_delete( :type service_name: str :param service_registry_name: The name of Service Registry. Required. :type service_registry_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: @@ -485,7 +451,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -494,17 +460,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list( @@ -517,7 +479,6 @@ def list( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceRegistryResource or the result of cls(response) :rtype: @@ -543,17 +504,16 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -564,14 +524,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) @@ -581,11 +541,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -596,7 +556,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_services_operations.py index 16694f8a0b1..c3ff76ffd02 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_services_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_services_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -598,7 +598,7 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_supported_server_versions_request( +def build_list_supported_server_versions_request( # pylint: disable=name-too-long resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -658,7 +658,6 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: @@ -679,21 +678,20 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo ) cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -705,16 +703,16 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return deserialized # type: ignore def _create_or_update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -741,7 +739,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -749,16 +747,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -781,10 +778,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_create_or_update( self, @@ -807,14 +800,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -827,7 +812,7 @@ def begin_create_or_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -840,18 +825,10 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -861,7 +838,11 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Create a new Service or update an exiting Service. @@ -871,19 +852,8 @@ def begin_create_or_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the create or update operation. Is either a ServiceResource - type or a IO type. Required. - :type resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -918,7 +888,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -928,17 +898,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -959,21 +927,20 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -983,11 +950,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -998,14 +961,6 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1034,7 +989,7 @@ def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: An def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1043,20 +998,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_initial( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> _models.ServiceResource: error_map = { 401: ClientAuthenticationError, @@ -1083,7 +1038,7 @@ def _update_initial( else: _json = self._serialize.body(resource, "ServiceResource") - request = build_update_request( + _request = build_update_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1091,16 +1046,15 @@ def _update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1120,10 +1074,6 @@ def _update_initial( return deserialized # type: ignore - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } - @overload def begin_update( self, @@ -1146,14 +1096,6 @@ def begin_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1166,7 +1108,7 @@ def begin_update( self, resource_group_name: str, service_name: str, - resource: IO, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1179,18 +1121,10 @@ def begin_update( :param service_name: The name of the Service resource. Required. :type service_name: str :param resource: Parameters for the update operation. Required. - :type resource: IO + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 ServiceResource or the result of cls(response) :rtype: @@ -1200,7 +1134,11 @@ def begin_update( @distributed_trace def begin_update( - self, resource_group_name: str, service_name: str, resource: Union[_models.ServiceResource, IO], **kwargs: Any + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any ) -> LROPoller[_models.ServiceResource]: """Operation to update an exiting Service. @@ -1209,20 +1147,9 @@ def begin_update( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param resource: Parameters for the update operation. Is either a ServiceResource type or a IO - type. Required. - :type resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceResource or IO[bytes] :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) :rtype: @@ -1257,7 +1184,7 @@ def begin_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("ServiceResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1267,17 +1194,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.ServiceResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}" - } + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1288,7 +1213,6 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1309,21 +1233,20 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_list_test_keys_request( + _request = build_list_test_keys_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_test_keys.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1335,13 +1258,9 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_test_keys.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys" - } + return deserialized # type: ignore @overload def regenerate_test_key( @@ -1366,7 +1285,6 @@ def regenerate_test_key( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1377,7 +1295,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: IO, + regenerate_test_key_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1390,11 +1308,10 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Required. - :type regenerate_test_key_request: IO + :type regenerate_test_key_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1405,7 +1322,7 @@ def regenerate_test_key( self, resource_group_name: str, service_name: str, - regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO], + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], **kwargs: Any ) -> _models.TestKeys: """Regenerate a test key for a Service. @@ -1416,13 +1333,9 @@ def regenerate_test_key( :param service_name: The name of the Service resource. Required. :type service_name: str :param regenerate_test_key_request: Parameters for the operation. Is either a - RegenerateTestKeyRequestPayload type or a IO type. Required. + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. :type regenerate_test_key_request: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.RegenerateTestKeyRequestPayload or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2024_01_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1452,7 +1365,7 @@ def regenerate_test_key( else: _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") - request = build_regenerate_test_key_request( + _request = build_regenerate_test_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -1460,16 +1373,15 @@ def regenerate_test_key( content_type=content_type, json=_json, content=_content, - template_url=self.regenerate_test_key.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1481,13 +1393,9 @@ def regenerate_test_key( deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - regenerate_test_key.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey" - } + return deserialized # type: ignore @distributed_trace def disable_test_endpoint( # pylint: disable=inconsistent-return-statements @@ -1500,7 +1408,6 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1521,21 +1428,20 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_disable_test_endpoint_request( + _request = build_disable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1545,11 +1451,7 @@ def disable_test_endpoint( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - disable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: @@ -1560,7 +1462,6 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: TestKeys or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: @@ -1581,21 +1482,20 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw ) cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) - request = build_enable_test_endpoint_request( + _request = build_enable_test_endpoint_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable_test_endpoint.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1607,13 +1507,9 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw deserialized = self._deserialize("TestKeys", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - enable_test_endpoint.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint" - } + return deserialized # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1634,35 +1530,30 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_stop_request( + _request = build_stop_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1673,14 +1564,6 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1709,7 +1592,7 @@ def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1718,17 +1601,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_stop.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1749,35 +1628,30 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_start_request( + _request = build_start_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1788,14 +1662,6 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1824,7 +1690,7 @@ def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1833,17 +1699,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_start.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, **kwargs: Any @@ -1864,21 +1726,20 @@ def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-stat ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_flush_vnet_dns_setting_request( + _request = build_flush_vnet_dns_setting_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._flush_vnet_dns_setting_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1891,11 +1752,7 @@ def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-stat response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _flush_vnet_dns_setting_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return cls(pipeline_response, None, response_headers) # type: ignore @distributed_trace def begin_flush_vnet_dns_setting( @@ -1908,14 +1765,6 @@ def begin_flush_vnet_dns_setting( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :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: @@ -1944,7 +1793,7 @@ def begin_flush_vnet_dns_setting( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -1955,17 +1804,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_flush_vnet_dns_setting.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list_supported_apm_types( @@ -1978,7 +1823,6 @@ def list_supported_apm_types( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedApmType or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.SupportedApmType] @@ -2003,17 +1847,16 @@ def list_supported_apm_types( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_apm_types_request( + _request = build_list_supported_apm_types_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_apm_types.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2024,14 +1867,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("SupportedApmTypes", pipeline_response) @@ -2041,11 +1884,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2057,10 +1900,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_supported_apm_types.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes" - } - @distributed_trace def list_globally_enabled_apms( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -2072,7 +1911,6 @@ def list_globally_enabled_apms( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: GloballyEnabledApms or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.GloballyEnabledApms :raises ~azure.core.exceptions.HttpResponseError: @@ -2093,21 +1931,20 @@ def list_globally_enabled_apms( ) cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None) - request = build_list_globally_enabled_apms_request( + _request = build_list_globally_enabled_apms_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_globally_enabled_apms.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2119,16 +1956,12 @@ def list_globally_enabled_apms( deserialized = self._deserialize("GloballyEnabledApms", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - list_globally_enabled_apms.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms" - } + return deserialized # type: ignore def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -2155,7 +1988,7 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme else: _json = self._serialize.body(apm, "ApmReference") - request = build_enable_apm_globally_request( + _request = build_enable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -2163,16 +1996,15 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme content_type=content_type, json=_json, content=_content, - template_url=self._enable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2186,11 +2018,7 @@ def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-stateme response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _enable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload def begin_enable_apm_globally( @@ -2214,14 +2042,6 @@ def begin_enable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2232,7 +2052,7 @@ def begin_enable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2245,18 +2065,10 @@ def begin_enable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the enable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2264,7 +2076,7 @@ def begin_enable_apm_globally( @distributed_trace def begin_enable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Enable an APM globally. @@ -2273,20 +2085,9 @@ def begin_enable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the enable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the enable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmReference or IO[bytes] :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: @@ -2318,7 +2119,7 @@ def begin_enable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2329,20 +2130,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_enable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -2369,7 +2166,7 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem else: _json = self._serialize.body(apm, "ApmReference") - request = build_disable_apm_globally_request( + _request = build_disable_apm_globally_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, @@ -2377,16 +2174,15 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem content_type=content_type, json=_json, content=_content, - template_url=self._disable_apm_globally_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2400,11 +2196,7 @@ def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statem response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) if cls: - return cls(pipeline_response, None, response_headers) - - _disable_apm_globally_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return cls(pipeline_response, None, response_headers) # type: ignore @overload def begin_disable_apm_globally( @@ -2428,14 +2220,6 @@ def begin_disable_apm_globally( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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: @@ -2446,7 +2230,7 @@ def begin_disable_apm_globally( self, resource_group_name: str, service_name: str, - apm: IO, + apm: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2459,18 +2243,10 @@ def begin_disable_apm_globally( :param service_name: The name of the Service resource. Required. :type service_name: str :param apm: The target APM for the disable operation. Required. - :type apm: IO + :type apm: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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: @@ -2478,7 +2254,7 @@ def begin_disable_apm_globally( @distributed_trace def begin_disable_apm_globally( - self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO], **kwargs: Any + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Disable an APM globally. @@ -2487,20 +2263,9 @@ def begin_disable_apm_globally( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :param apm: The target APM for the disable operation. Is either a ApmReference type or a IO - type. Required. - :type apm: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmReference or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + :param apm: The target APM for the disable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2024_01_01_preview.models.ApmReference or IO[bytes] :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: @@ -2532,7 +2297,7 @@ def begin_disable_apm_globally( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast( @@ -2543,17 +2308,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_disable_apm_globally.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload def check_name_availability( @@ -2574,7 +2335,6 @@ def check_name_availability( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2582,18 +2342,22 @@ def check_name_availability( @overload def check_name_availability( - self, location: str, availability_parameters: IO, *, content_type: str = "application/json", **kwargs: Any + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Required. - :type availability_parameters: IO + :type availability_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2601,20 +2365,19 @@ def check_name_availability( @distributed_trace def check_name_availability( - self, location: str, availability_parameters: Union[_models.NameAvailabilityParameters, IO], **kwargs: Any + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any ) -> _models.NameAvailability: """Checks that the resource name is valid and is not already in use. :param location: the region. Required. :type location: str :param availability_parameters: Parameters supplied to the operation. Is either a - NameAvailabilityParameters type or a IO type. Required. + NameAvailabilityParameters type or a IO[bytes] type. Required. :type availability_parameters: - ~azure.mgmt.appplatform.v2024_01_01_preview.models.NameAvailabilityParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + ~azure.mgmt.appplatform.v2024_01_01_preview.models.NameAvailabilityParameters or IO[bytes] :return: NameAvailability or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: @@ -2644,23 +2407,22 @@ def check_name_availability( else: _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") - request = build_check_name_availability_request( + _request = build_check_name_availability_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.check_name_availability.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2672,19 +2434,14 @@ def check_name_availability( deserialized = self._deserialize("NameAvailability", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - check_name_availability.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability" - } + return deserialized # type: ignore @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceResource] @@ -2709,15 +2466,14 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour def prepare_request(next_link=None): if not next_link: - request = build_list_by_subscription_request( + _request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2728,14 +2484,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2745,11 +2501,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2761,8 +2517,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring"} - @distributed_trace def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: """Handles requests to list all resources in a resource group. @@ -2770,7 +2524,6 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser :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. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServiceResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.ServiceResource] @@ -2795,16 +2548,15 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2815,14 +2567,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceList", pipeline_response) @@ -2832,11 +2584,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2848,10 +2600,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" - } - @distributed_trace def list_supported_server_versions( self, resource_group_name: str, service_name: str, **kwargs: Any @@ -2863,7 +2611,6 @@ def list_supported_server_versions( :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SupportedServerVersion or the result of cls(response) :rtype: @@ -2889,17 +2636,16 @@ def list_supported_server_versions( def prepare_request(next_link=None): if not next_link: - request = build_list_supported_server_versions_request( + _request = build_list_supported_server_versions_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_supported_server_versions.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2910,14 +2656,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("SupportedServerVersions", pipeline_response) @@ -2927,11 +2673,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2942,7 +2688,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list_supported_server_versions.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedServerVersions" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_skus_operations.py index 4912e9f5bb4..0ecacb76e17 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_skus_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_skus_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -84,7 +84,6 @@ def __init__(self, *args, **kwargs): def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: """Lists all of the available skus of the Microsoft.AppPlatform provider. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSku or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.ResourceSku] @@ -109,15 +108,14 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -128,14 +126,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) @@ -145,11 +143,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,5 +158,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus"} diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_storages_operations.py index 21f60991702..4dc210f92f7 100644 --- a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_storages_operations.py +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_01_01_preview/operations/_storages_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -200,7 +200,6 @@ def get( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageResource or the result of cls(response) :rtype: ~azure.mgmt.appplatform.v2024_01_01_preview.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: @@ -221,22 +220,21 @@ def get( ) cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) - request = build_get_request( + _request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -248,20 +246,16 @@ def get( deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return deserialized # type: ignore def _create_or_update_initial( self, resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> _models.StorageResource: error_map = { @@ -289,7 +283,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(storage_resource, "StorageResource") - request = build_create_or_update_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, @@ -298,16 +292,15 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -330,10 +323,6 @@ def _create_or_update_initial( return deserialized # type: ignore - _create_or_update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } - @overload def begin_create_or_update( self, @@ -359,14 +348,6 @@ def begin_create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -380,7 +361,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: IO, + storage_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -395,18 +376,10 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Required. - :type storage_resource: IO + :type storage_resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: 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 StorageResource or the result of cls(response) :rtype: @@ -420,7 +393,7 @@ def begin_create_or_update( resource_group_name: str, service_name: str, storage_name: str, - storage_resource: Union[_models.StorageResource, IO], + storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.StorageResource]: """Create or update storage resource. @@ -433,20 +406,9 @@ def begin_create_or_update( :param storage_name: The name of the storage resource. Required. :type storage_name: str :param storage_resource: Parameters for the create or update operation. Is either a - StorageResource type or a IO type. Required. + StorageResource type or a IO[bytes] type. Required. :type storage_resource: ~azure.mgmt.appplatform.v2024_01_01_preview.models.StorageResource or - IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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. + IO[bytes] :return: An instance of LROPoller that returns either StorageResource or the result of cls(response) :rtype: @@ -482,7 +444,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): deserialized = self._deserialize("StorageResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -492,17 +454,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[_models.StorageResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_or_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any @@ -523,22 +483,21 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + _request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +507,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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}/storages/{storageName}" - } + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def begin_delete( @@ -567,14 +522,6 @@ def begin_delete( :type service_name: str :param storage_name: The name of the storage resource. Required. :type storage_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: @@ -604,7 +551,7 @@ def begin_delete( def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -613,17 +560,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: @@ -634,7 +577,6 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It :type resource_group_name: str :param service_name: The name of the Service resource. Required. :type service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either StorageResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_01_01_preview.models.StorageResource] @@ -659,17 +601,16 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - request = build_list_request( + _request = build_list_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -680,14 +621,14 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("StorageResourceCollection", pipeline_response) @@ -697,11 +638,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -712,7 +653,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - list.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" - } diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/__init__.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/__init__.py new file mode 100644 index 00000000000..d0d782a6dee --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/__init__.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._app_platform_management_client import AppPlatformManagementClient +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AppPlatformManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_app_platform_management_client.py new file mode 100644 index 00000000000..196ff353d68 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_app_platform_management_client.py @@ -0,0 +1,335 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy + +from . import models as _models +from .._serialization import Deserializer, Serializer +from ._configuration import AppPlatformManagementClientConfiguration +from .operations import ( + ApiPortalCustomDomainsOperations, + ApiPortalsOperations, + ApmsOperations, + ApplicationAcceleratorsOperations, + ApplicationLiveViewsOperations, + AppsOperations, + BindingsOperations, + BuildServiceAgentPoolOperations, + BuildServiceBuilderOperations, + BuildServiceOperations, + BuildpackBindingOperations, + CertificatesOperations, + ConfigServersOperations, + ConfigurationServicesOperations, + ContainerRegistriesOperations, + CustomDomainsOperations, + CustomizedAcceleratorsOperations, + DeploymentsOperations, + DevToolPortalsOperations, + EurekaServersOperations, + GatewayCustomDomainsOperations, + GatewayRouteConfigsOperations, + GatewaysOperations, + JobExecutionOperations, + JobExecutionsOperations, + JobOperations, + JobsOperations, + MonitoringSettingsOperations, + Operations, + PredefinedAcceleratorsOperations, + RuntimeVersionsOperations, + ServiceRegistriesOperations, + ServicesOperations, + SkusOperations, + StoragesOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class AppPlatformManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes + """REST API for Azure Spring Apps. + + :ivar services: ServicesOperations operations + :vartype services: azure.mgmt.appplatform.v2024_05_01_preview.operations.ServicesOperations + :ivar apms: ApmsOperations operations + :vartype apms: azure.mgmt.appplatform.v2024_05_01_preview.operations.ApmsOperations + :ivar eureka_servers: EurekaServersOperations operations + :vartype eureka_servers: + azure.mgmt.appplatform.v2024_05_01_preview.operations.EurekaServersOperations + :ivar config_servers: ConfigServersOperations operations + :vartype config_servers: + azure.mgmt.appplatform.v2024_05_01_preview.operations.ConfigServersOperations + :ivar configuration_services: ConfigurationServicesOperations operations + :vartype configuration_services: + azure.mgmt.appplatform.v2024_05_01_preview.operations.ConfigurationServicesOperations + :ivar service_registries: ServiceRegistriesOperations operations + :vartype service_registries: + azure.mgmt.appplatform.v2024_05_01_preview.operations.ServiceRegistriesOperations + :ivar application_live_views: ApplicationLiveViewsOperations operations + :vartype application_live_views: + azure.mgmt.appplatform.v2024_05_01_preview.operations.ApplicationLiveViewsOperations + :ivar dev_tool_portals: DevToolPortalsOperations operations + :vartype dev_tool_portals: + azure.mgmt.appplatform.v2024_05_01_preview.operations.DevToolPortalsOperations + :ivar container_registries: ContainerRegistriesOperations operations + :vartype container_registries: + azure.mgmt.appplatform.v2024_05_01_preview.operations.ContainerRegistriesOperations + :ivar build_service: BuildServiceOperations operations + :vartype build_service: + azure.mgmt.appplatform.v2024_05_01_preview.operations.BuildServiceOperations + :ivar buildpack_binding: BuildpackBindingOperations operations + :vartype buildpack_binding: + azure.mgmt.appplatform.v2024_05_01_preview.operations.BuildpackBindingOperations + :ivar build_service_builder: BuildServiceBuilderOperations operations + :vartype build_service_builder: + azure.mgmt.appplatform.v2024_05_01_preview.operations.BuildServiceBuilderOperations + :ivar build_service_agent_pool: BuildServiceAgentPoolOperations operations + :vartype build_service_agent_pool: + azure.mgmt.appplatform.v2024_05_01_preview.operations.BuildServiceAgentPoolOperations + :ivar monitoring_settings: MonitoringSettingsOperations operations + :vartype monitoring_settings: + azure.mgmt.appplatform.v2024_05_01_preview.operations.MonitoringSettingsOperations + :ivar apps: AppsOperations operations + :vartype apps: azure.mgmt.appplatform.v2024_05_01_preview.operations.AppsOperations + :ivar bindings: BindingsOperations operations + :vartype bindings: azure.mgmt.appplatform.v2024_05_01_preview.operations.BindingsOperations + :ivar storages: StoragesOperations operations + :vartype storages: azure.mgmt.appplatform.v2024_05_01_preview.operations.StoragesOperations + :ivar certificates: CertificatesOperations operations + :vartype certificates: + azure.mgmt.appplatform.v2024_05_01_preview.operations.CertificatesOperations + :ivar custom_domains: CustomDomainsOperations operations + :vartype custom_domains: + azure.mgmt.appplatform.v2024_05_01_preview.operations.CustomDomainsOperations + :ivar deployments: DeploymentsOperations operations + :vartype deployments: + azure.mgmt.appplatform.v2024_05_01_preview.operations.DeploymentsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.appplatform.v2024_05_01_preview.operations.Operations + :ivar runtime_versions: RuntimeVersionsOperations operations + :vartype runtime_versions: + azure.mgmt.appplatform.v2024_05_01_preview.operations.RuntimeVersionsOperations + :ivar skus: SkusOperations operations + :vartype skus: azure.mgmt.appplatform.v2024_05_01_preview.operations.SkusOperations + :ivar gateways: GatewaysOperations operations + :vartype gateways: azure.mgmt.appplatform.v2024_05_01_preview.operations.GatewaysOperations + :ivar gateway_route_configs: GatewayRouteConfigsOperations operations + :vartype gateway_route_configs: + azure.mgmt.appplatform.v2024_05_01_preview.operations.GatewayRouteConfigsOperations + :ivar gateway_custom_domains: GatewayCustomDomainsOperations operations + :vartype gateway_custom_domains: + azure.mgmt.appplatform.v2024_05_01_preview.operations.GatewayCustomDomainsOperations + :ivar api_portals: ApiPortalsOperations operations + :vartype api_portals: + azure.mgmt.appplatform.v2024_05_01_preview.operations.ApiPortalsOperations + :ivar api_portal_custom_domains: ApiPortalCustomDomainsOperations operations + :vartype api_portal_custom_domains: + azure.mgmt.appplatform.v2024_05_01_preview.operations.ApiPortalCustomDomainsOperations + :ivar application_accelerators: ApplicationAcceleratorsOperations operations + :vartype application_accelerators: + azure.mgmt.appplatform.v2024_05_01_preview.operations.ApplicationAcceleratorsOperations + :ivar customized_accelerators: CustomizedAcceleratorsOperations operations + :vartype customized_accelerators: + azure.mgmt.appplatform.v2024_05_01_preview.operations.CustomizedAcceleratorsOperations + :ivar predefined_accelerators: PredefinedAcceleratorsOperations operations + :vartype predefined_accelerators: + azure.mgmt.appplatform.v2024_05_01_preview.operations.PredefinedAcceleratorsOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.appplatform.v2024_05_01_preview.operations.JobsOperations + :ivar job: JobOperations operations + :vartype job: azure.mgmt.appplatform.v2024_05_01_preview.operations.JobOperations + :ivar job_execution: JobExecutionOperations operations + :vartype job_execution: + azure.mgmt.appplatform.v2024_05_01_preview.operations.JobExecutionOperations + :ivar job_executions: JobExecutionsOperations operations + :vartype job_executions: + azure.mgmt.appplatform.v2024_05_01_preview.operations.JobExecutionsOperations + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Gets subscription ID which uniquely identify the Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. Required. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2024-05-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = AppPlatformManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.services = ServicesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.apms = ApmsOperations(self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview") + self.eureka_servers = EurekaServersOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.config_servers = ConfigServersOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.configuration_services = ConfigurationServicesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.service_registries = ServiceRegistriesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.application_live_views = ApplicationLiveViewsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.dev_tool_portals = DevToolPortalsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.container_registries = ContainerRegistriesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.build_service = BuildServiceOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.buildpack_binding = BuildpackBindingOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.build_service_builder = BuildServiceBuilderOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.build_service_agent_pool = BuildServiceAgentPoolOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.monitoring_settings = MonitoringSettingsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.apps = AppsOperations(self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview") + self.bindings = BindingsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.storages = StoragesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.certificates = CertificatesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.custom_domains = CustomDomainsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.runtime_versions = RuntimeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview") + self.gateways = GatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.gateway_route_configs = GatewayRouteConfigsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.gateway_custom_domains = GatewayCustomDomainsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.api_portals = ApiPortalsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.api_portal_custom_domains = ApiPortalCustomDomainsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.application_accelerators = ApplicationAcceleratorsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.customized_accelerators = CustomizedAcceleratorsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.predefined_accelerators = PredefinedAcceleratorsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview") + self.job = JobOperations(self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview") + self.job_execution = JobExecutionOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.job_executions = JobExecutionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> "AppPlatformManagementClient": + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_configuration.py new file mode 100644 index 00000000000..26305f3204e --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for AppPlatformManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Gets subscription ID which uniquely identify the Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. Required. + :type subscription_id: str + :keyword api_version: Api Version. Default value is "2024-05-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "2024-05-01-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_patch.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_vendor.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_vendor.py new file mode 100644 index 00000000000..0dafe0e287f --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_vendor.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_version.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_version.py new file mode 100644 index 00000000000..92453d8691d --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "6.1.0" diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/__init__.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/__init__.py new file mode 100644 index 00000000000..99174a0dabf --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._app_platform_management_client import AppPlatformManagementClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AppPlatformManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/_app_platform_management_client.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/_app_platform_management_client.py new file mode 100644 index 00000000000..1d47ea23e7f --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/_app_platform_management_client.py @@ -0,0 +1,337 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy + +from .. import models as _models +from ..._serialization import Deserializer, Serializer +from ._configuration import AppPlatformManagementClientConfiguration +from .operations import ( + ApiPortalCustomDomainsOperations, + ApiPortalsOperations, + ApmsOperations, + ApplicationAcceleratorsOperations, + ApplicationLiveViewsOperations, + AppsOperations, + BindingsOperations, + BuildServiceAgentPoolOperations, + BuildServiceBuilderOperations, + BuildServiceOperations, + BuildpackBindingOperations, + CertificatesOperations, + ConfigServersOperations, + ConfigurationServicesOperations, + ContainerRegistriesOperations, + CustomDomainsOperations, + CustomizedAcceleratorsOperations, + DeploymentsOperations, + DevToolPortalsOperations, + EurekaServersOperations, + GatewayCustomDomainsOperations, + GatewayRouteConfigsOperations, + GatewaysOperations, + JobExecutionOperations, + JobExecutionsOperations, + JobOperations, + JobsOperations, + MonitoringSettingsOperations, + Operations, + PredefinedAcceleratorsOperations, + RuntimeVersionsOperations, + ServiceRegistriesOperations, + ServicesOperations, + SkusOperations, + StoragesOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class AppPlatformManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes + """REST API for Azure Spring Apps. + + :ivar services: ServicesOperations operations + :vartype services: azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.ServicesOperations + :ivar apms: ApmsOperations operations + :vartype apms: azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.ApmsOperations + :ivar eureka_servers: EurekaServersOperations operations + :vartype eureka_servers: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.EurekaServersOperations + :ivar config_servers: ConfigServersOperations operations + :vartype config_servers: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.ConfigServersOperations + :ivar configuration_services: ConfigurationServicesOperations operations + :vartype configuration_services: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.ConfigurationServicesOperations + :ivar service_registries: ServiceRegistriesOperations operations + :vartype service_registries: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.ServiceRegistriesOperations + :ivar application_live_views: ApplicationLiveViewsOperations operations + :vartype application_live_views: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.ApplicationLiveViewsOperations + :ivar dev_tool_portals: DevToolPortalsOperations operations + :vartype dev_tool_portals: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.DevToolPortalsOperations + :ivar container_registries: ContainerRegistriesOperations operations + :vartype container_registries: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.ContainerRegistriesOperations + :ivar build_service: BuildServiceOperations operations + :vartype build_service: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.BuildServiceOperations + :ivar buildpack_binding: BuildpackBindingOperations operations + :vartype buildpack_binding: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.BuildpackBindingOperations + :ivar build_service_builder: BuildServiceBuilderOperations operations + :vartype build_service_builder: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.BuildServiceBuilderOperations + :ivar build_service_agent_pool: BuildServiceAgentPoolOperations operations + :vartype build_service_agent_pool: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.BuildServiceAgentPoolOperations + :ivar monitoring_settings: MonitoringSettingsOperations operations + :vartype monitoring_settings: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.MonitoringSettingsOperations + :ivar apps: AppsOperations operations + :vartype apps: azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.AppsOperations + :ivar bindings: BindingsOperations operations + :vartype bindings: azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.BindingsOperations + :ivar storages: StoragesOperations operations + :vartype storages: azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.StoragesOperations + :ivar certificates: CertificatesOperations operations + :vartype certificates: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.CertificatesOperations + :ivar custom_domains: CustomDomainsOperations operations + :vartype custom_domains: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.CustomDomainsOperations + :ivar deployments: DeploymentsOperations operations + :vartype deployments: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.DeploymentsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.Operations + :ivar runtime_versions: RuntimeVersionsOperations operations + :vartype runtime_versions: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.RuntimeVersionsOperations + :ivar skus: SkusOperations operations + :vartype skus: azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.SkusOperations + :ivar gateways: GatewaysOperations operations + :vartype gateways: azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.GatewaysOperations + :ivar gateway_route_configs: GatewayRouteConfigsOperations operations + :vartype gateway_route_configs: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.GatewayRouteConfigsOperations + :ivar gateway_custom_domains: GatewayCustomDomainsOperations operations + :vartype gateway_custom_domains: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.GatewayCustomDomainsOperations + :ivar api_portals: ApiPortalsOperations operations + :vartype api_portals: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.ApiPortalsOperations + :ivar api_portal_custom_domains: ApiPortalCustomDomainsOperations operations + :vartype api_portal_custom_domains: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.ApiPortalCustomDomainsOperations + :ivar application_accelerators: ApplicationAcceleratorsOperations operations + :vartype application_accelerators: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.ApplicationAcceleratorsOperations + :ivar customized_accelerators: CustomizedAcceleratorsOperations operations + :vartype customized_accelerators: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.CustomizedAcceleratorsOperations + :ivar predefined_accelerators: PredefinedAcceleratorsOperations operations + :vartype predefined_accelerators: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.PredefinedAcceleratorsOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.JobsOperations + :ivar job: JobOperations operations + :vartype job: azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.JobOperations + :ivar job_execution: JobExecutionOperations operations + :vartype job_execution: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.JobExecutionOperations + :ivar job_executions: JobExecutionsOperations operations + :vartype job_executions: + azure.mgmt.appplatform.v2024_05_01_preview.aio.operations.JobExecutionsOperations + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Gets subscription ID which uniquely identify the Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. Required. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2024-05-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = AppPlatformManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.services = ServicesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.apms = ApmsOperations(self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview") + self.eureka_servers = EurekaServersOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.config_servers = ConfigServersOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.configuration_services = ConfigurationServicesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.service_registries = ServiceRegistriesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.application_live_views = ApplicationLiveViewsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.dev_tool_portals = DevToolPortalsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.container_registries = ContainerRegistriesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.build_service = BuildServiceOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.buildpack_binding = BuildpackBindingOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.build_service_builder = BuildServiceBuilderOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.build_service_agent_pool = BuildServiceAgentPoolOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.monitoring_settings = MonitoringSettingsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.apps = AppsOperations(self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview") + self.bindings = BindingsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.storages = StoragesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.certificates = CertificatesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.custom_domains = CustomDomainsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.runtime_versions = RuntimeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview") + self.gateways = GatewaysOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.gateway_route_configs = GatewayRouteConfigsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.gateway_custom_domains = GatewayCustomDomainsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.api_portals = ApiPortalsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.api_portal_custom_domains = ApiPortalCustomDomainsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.application_accelerators = ApplicationAcceleratorsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.customized_accelerators = CustomizedAcceleratorsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.predefined_accelerators = PredefinedAcceleratorsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview") + self.job = JobOperations(self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview") + self.job_execution = JobExecutionOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + self.job_executions = JobExecutionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-05-01-preview" + ) + + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "AppPlatformManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/_configuration.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/_configuration.py new file mode 100644 index 00000000000..a0f4cc9966a --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for AppPlatformManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Gets subscription ID which uniquely identify the Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. Required. + :type subscription_id: str + :keyword api_version: Api Version. Default value is "2024-05-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "2024-05-01-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-appplatform/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/_patch.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/__init__.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/__init__.py new file mode 100644 index 00000000000..fe654e1adb1 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/__init__.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._services_operations import ServicesOperations +from ._apms_operations import ApmsOperations +from ._eureka_servers_operations import EurekaServersOperations +from ._config_servers_operations import ConfigServersOperations +from ._configuration_services_operations import ConfigurationServicesOperations +from ._service_registries_operations import ServiceRegistriesOperations +from ._application_live_views_operations import ApplicationLiveViewsOperations +from ._dev_tool_portals_operations import DevToolPortalsOperations +from ._container_registries_operations import ContainerRegistriesOperations +from ._build_service_operations import BuildServiceOperations +from ._buildpack_binding_operations import BuildpackBindingOperations +from ._build_service_builder_operations import BuildServiceBuilderOperations +from ._build_service_agent_pool_operations import BuildServiceAgentPoolOperations +from ._monitoring_settings_operations import MonitoringSettingsOperations +from ._apps_operations import AppsOperations +from ._bindings_operations import BindingsOperations +from ._storages_operations import StoragesOperations +from ._certificates_operations import CertificatesOperations +from ._custom_domains_operations import CustomDomainsOperations +from ._deployments_operations import DeploymentsOperations +from ._operations import Operations +from ._runtime_versions_operations import RuntimeVersionsOperations +from ._skus_operations import SkusOperations +from ._gateways_operations import GatewaysOperations +from ._gateway_route_configs_operations import GatewayRouteConfigsOperations +from ._gateway_custom_domains_operations import GatewayCustomDomainsOperations +from ._api_portals_operations import ApiPortalsOperations +from ._api_portal_custom_domains_operations import ApiPortalCustomDomainsOperations +from ._application_accelerators_operations import ApplicationAcceleratorsOperations +from ._customized_accelerators_operations import CustomizedAcceleratorsOperations +from ._predefined_accelerators_operations import PredefinedAcceleratorsOperations +from ._jobs_operations import JobsOperations +from ._job_operations import JobOperations +from ._job_execution_operations import JobExecutionOperations +from ._job_executions_operations import JobExecutionsOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ServicesOperations", + "ApmsOperations", + "EurekaServersOperations", + "ConfigServersOperations", + "ConfigurationServicesOperations", + "ServiceRegistriesOperations", + "ApplicationLiveViewsOperations", + "DevToolPortalsOperations", + "ContainerRegistriesOperations", + "BuildServiceOperations", + "BuildpackBindingOperations", + "BuildServiceBuilderOperations", + "BuildServiceAgentPoolOperations", + "MonitoringSettingsOperations", + "AppsOperations", + "BindingsOperations", + "StoragesOperations", + "CertificatesOperations", + "CustomDomainsOperations", + "DeploymentsOperations", + "Operations", + "RuntimeVersionsOperations", + "SkusOperations", + "GatewaysOperations", + "GatewayRouteConfigsOperations", + "GatewayCustomDomainsOperations", + "ApiPortalsOperations", + "ApiPortalCustomDomainsOperations", + "ApplicationAcceleratorsOperations", + "CustomizedAcceleratorsOperations", + "PredefinedAcceleratorsOperations", + "JobsOperations", + "JobOperations", + "JobExecutionOperations", + "JobExecutionsOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_api_portal_custom_domains_operations.py new file mode 100644 index 00000000000..8f0dffa2a8d --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_api_portal_custom_domains_operations.py @@ -0,0 +1,555 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._api_portal_custom_domains_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ApiPortalCustomDomainsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`api_portal_custom_domains` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any + ) -> _models.ApiPortalCustomDomainResource: + """Get the API portal custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param domain_name: The name of the API portal custom domain. Required. + :type domain_name: str + :return: ApiPortalCustomDomainResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + domain_name: str, + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> _models.ApiPortalCustomDomainResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(api_portal_custom_domain_resource, (IOBase, bytes)): + _content = api_portal_custom_domain_resource + else: + _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + domain_name: str, + api_portal_custom_domain_resource: _models.ApiPortalCustomDomainResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: + """Create or update the API portal custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param domain_name: The name of the API portal custom domain. Required. + :type domain_name: str + :param api_portal_custom_domain_resource: The API portal custom domain for the create or update + operation. Required. + :type api_portal_custom_domain_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + domain_name: str, + api_portal_custom_domain_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: + """Create or update the API portal custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param domain_name: The name of the API portal custom domain. Required. + :type domain_name: str + :param api_portal_custom_domain_resource: The API portal custom domain for the create or update + operation. Required. + :type api_portal_custom_domain_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + domain_name: str, + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ApiPortalCustomDomainResource]: + """Create or update the API portal custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param domain_name: The name of the API portal custom domain. Required. + :type domain_name: str + :param api_portal_custom_domain_resource: The API portal custom domain for the create or update + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. + :type api_portal_custom_domain_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ApiPortalCustomDomainResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + domain_name=domain_name, + api_portal_custom_domain_resource=api_portal_custom_domain_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete the API portal custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param domain_name: The name of the API portal custom domain. Required. + :type domain_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + domain_name=domain_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ApiPortalCustomDomainResource"]: + """Handle requests to list all API portal custom domains. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApiPortalCustomDomainResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_api_portals_operations.py new file mode 100644 index 00000000000..a9f34f4c514 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_api_portals_operations.py @@ -0,0 +1,675 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._api_portals_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_validate_domain_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ApiPortalsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`api_portals` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any + ) -> _models.ApiPortalResource: + """Get the API portal and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :return: ApiPortalResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApiPortalResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], + **kwargs: Any + ) -> _models.ApiPortalResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(api_portal_resource, (IOBase, bytes)): + _content = api_portal_resource + else: + _json = self._serialize.body(api_portal_resource, "ApiPortalResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApiPortalResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApiPortalResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + api_portal_resource: _models.ApiPortalResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApiPortalResource]: + """Create the default API portal or update the existing API portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param api_portal_resource: The API portal for the create or update operation. Required. + :type api_portal_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + api_portal_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApiPortalResource]: + """Create the default API portal or update the existing API portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param api_portal_resource: The API portal for the create or update operation. Required. + :type api_portal_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ApiPortalResource]: + """Create the default API portal or update the existing API portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param api_portal_resource: The API portal for the create or update operation. Is either a + ApiPortalResource type or a IO[bytes] type. Required. + :type api_portal_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ApiPortalResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + api_portal_resource=api_portal_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApiPortalResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApiPortalResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete the default API portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ApiPortalResource"]: + """Handles requests to list all resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ApiPortalResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApiPortalResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @overload + async def validate_domain( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + validate_payload: _models.CustomDomainValidatePayload, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the domains are valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param validate_payload: Custom domain payload to be validated. Required. + :type validate_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidatePayload + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate_domain( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + validate_payload: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the domains are valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param validate_payload: Custom domain payload to be validated. Required. + :type validate_payload: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def validate_domain( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the domains are valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param validate_payload: Custom domain payload to be validated. Is either a + CustomDomainValidatePayload type or a IO[bytes] type. Required. + :type validate_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomDomainValidateResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(validate_payload, (IOBase, bytes)): + _content = validate_payload + else: + _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") + + _request = build_validate_domain_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_apms_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_apms_operations.py new file mode 100644 index 00000000000..1ac539e5634 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_apms_operations.py @@ -0,0 +1,596 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._apms_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_list_secret_keys_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ApmsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`apms` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.ApmResource"]: + """Get collection of APMs. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ApmResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApmResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApmResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any + ) -> _models.ApmResource: + """Get the APM by name. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm_name: The name of the APM. Required. + :type apm_name: str + :return: ApmResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + apm_name=apm_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApmResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + apm_name: str, + apm_resource: Union[_models.ApmResource, IO[bytes]], + **kwargs: Any + ) -> _models.ApmResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(apm_resource, (IOBase, bytes)): + _content = apm_resource + else: + _json = self._serialize.body(apm_resource, "ApmResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + apm_name=apm_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApmResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApmResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + apm_name: str, + apm_resource: _models.ApmResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApmResource]: + """Create or update an APM. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm_name: The name of the APM. Required. + :type apm_name: str + :param apm_resource: Parameters for the create or update operation. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ApmResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + apm_name: str, + apm_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApmResource]: + """Create or update an APM. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm_name: The name of the APM. Required. + :type apm_name: str + :param apm_resource: Parameters for the create or update operation. Required. + :type apm_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ApmResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + apm_name: str, + apm_resource: Union[_models.ApmResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ApmResource]: + """Create or update an APM. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm_name: The name of the APM. Required. + :type apm_name: str + :param apm_resource: Parameters for the create or update operation. Is either a ApmResource + type or a IO[bytes] type. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ApmResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + apm_name=apm_name, + apm_resource=apm_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApmResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApmResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApmResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + apm_name=apm_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Operation to delete an APM. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm_name: The name of the APM. Required. + :type apm_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + apm_name=apm_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def list_secret_keys( + self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any + ) -> _models.ApmSecretKeys: + """List keys of APM sensitive properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm_name: The name of the APM. Required. + :type apm_name: str + :return: ApmSecretKeys or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmSecretKeys + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None) + + _request = build_list_secret_keys_request( + resource_group_name=resource_group_name, + service_name=service_name, + apm_name=apm_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApmSecretKeys", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_application_accelerators_operations.py new file mode 100644 index 00000000000..12586131089 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_application_accelerators_operations.py @@ -0,0 +1,537 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._application_accelerators_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ApplicationAcceleratorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`application_accelerators` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ApplicationAcceleratorResource"]: + """Handle requests to list all application accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ApplicationAcceleratorResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApplicationAcceleratorResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any + ) -> _models.ApplicationAcceleratorResource: + """Get the application accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :return: ApplicationAcceleratorResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationAcceleratorResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(application_accelerator_resource, (IOBase, bytes)): + _content = application_accelerator_resource + else: + _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + application_accelerator_resource: _models.ApplicationAcceleratorResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]: + """Create or update the application accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param application_accelerator_resource: The application accelerator for the create or update + operation. Required. + :type application_accelerator_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + application_accelerator_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]: + """Create or update the application accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param application_accelerator_resource: The application accelerator for the create or update + operation. Required. + :type application_accelerator_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]: + """Create or update the application accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param application_accelerator_resource: The application accelerator for the create or update + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. + :type application_accelerator_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + application_accelerator_resource=application_accelerator_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete the application accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_application_live_views_operations.py new file mode 100644 index 00000000000..892761ae49b --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_application_live_views_operations.py @@ -0,0 +1,535 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._application_live_views_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ApplicationLiveViewsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`application_live_views` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ApplicationLiveViewResource"]: + """Handles requests to list all resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ApplicationLiveViewResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApplicationLiveViewResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any + ) -> _models.ApplicationLiveViewResource: + """Get the Application Live and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_live_view_name: The name of Application Live View. Required. + :type application_live_view_name: str + :return: ApplicationLiveViewResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_live_view_name=application_live_view_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + application_live_view_name: str, + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationLiveViewResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(application_live_view_resource, (IOBase, bytes)): + _content = application_live_view_resource + else: + _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_live_view_name=application_live_view_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_live_view_name: str, + application_live_view_resource: _models.ApplicationLiveViewResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationLiveViewResource]: + """Create the default Application Live View or update the existing Application Live View. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_live_view_name: The name of Application Live View. Required. + :type application_live_view_name: str + :param application_live_view_resource: Parameters for the update operation. Required. + :type application_live_view_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_live_view_name: str, + application_live_view_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationLiveViewResource]: + """Create the default Application Live View or update the existing Application Live View. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_live_view_name: The name of Application Live View. Required. + :type application_live_view_name: str + :param application_live_view_resource: Parameters for the update operation. Required. + :type application_live_view_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_live_view_name: str, + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ApplicationLiveViewResource]: + """Create the default Application Live View or update the existing Application Live View. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_live_view_name: The name of Application Live View. Required. + :type application_live_view_name: str + :param application_live_view_resource: Parameters for the update operation. Is either a + ApplicationLiveViewResource type or a IO[bytes] type. Required. + :type application_live_view_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + application_live_view_name=application_live_view_name, + application_live_view_resource=application_live_view_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ApplicationLiveViewResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_live_view_name=application_live_view_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disable the default Application Live View. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_live_view_name: The name of Application Live View. Required. + :type application_live_view_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + application_live_view_name=application_live_view_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_apps_operations.py new file mode 100644 index 00000000000..9775d6a9877 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_apps_operations.py @@ -0,0 +1,1171 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._apps_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_get_resource_upload_url_request, + build_list_request, + build_set_active_deployments_request, + build_update_request, + build_validate_domain_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class AppsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`apps` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + service_name: str, + app_name: str, + sync_status: Optional[str] = None, + **kwargs: Any + ) -> _models.AppResource: + """Get an App and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param sync_status: Indicates whether sync status. Default value is None. + :type sync_status: str + :return: AppResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + sync_status=sync_status, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AppResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: Union[_models.AppResource, IO[bytes]], + **kwargs: Any + ) -> _models.AppResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(app_resource, (IOBase, bytes)): + _content = app_resource + else: + _json = self._serialize.body(app_resource, "AppResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AppResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("AppResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("AppResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: _models.AppResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AppResource]: + """Create a new App or update an exiting App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param app_resource: Parameters for the create or update operation. Required. + :type app_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AppResource]: + """Create a new App or update an exiting App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param app_resource: Parameters for the create or update operation. Required. + :type app_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: Union[_models.AppResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AppResource]: + """Create a new App or update an exiting App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param app_resource: Parameters for the create or update operation. Is either a AppResource + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + app_resource=app_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AppResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AppResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Operation to delete an App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: Union[_models.AppResource, IO[bytes]], + **kwargs: Any + ) -> _models.AppResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(app_resource, (IOBase, bytes)): + _content = app_resource + else: + _json = self._serialize.body(app_resource, "AppResource") + + _request = build_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AppResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("AppResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: _models.AppResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AppResource]: + """Operation to update an exiting App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param app_resource: Parameters for the update operation. Required. + :type app_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AppResource]: + """Operation to update an exiting App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param app_resource: Parameters for the update operation. Required. + :type app_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: Union[_models.AppResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AppResource]: + """Operation to update an exiting App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + app_resource=app_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AppResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AppResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResource"]: + """Handles requests to list all resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either AppResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.AppResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AppResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_resource_upload_url( + self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any + ) -> _models.ResourceUploadDefinition: + """Get an resource upload URL for an App, which may be artifacts or source archive. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :return: ResourceUploadDefinition or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceUploadDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) + + _request = build_get_resource_upload_url_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _set_active_deployments_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], + **kwargs: Any + ) -> _models.AppResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(active_deployment_collection, (IOBase, bytes)): + _content = active_deployment_collection + else: + _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") + + _request = build_set_active_deployments_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AppResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("AppResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_set_active_deployments( + self, + resource_group_name: str, + service_name: str, + app_name: str, + active_deployment_collection: _models.ActiveDeploymentCollection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AppResource]: + """Set existing Deployment under the app as active. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param active_deployment_collection: A list of Deployment name to be active. Required. + :type active_deployment_collection: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ActiveDeploymentCollection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_set_active_deployments( + self, + resource_group_name: str, + service_name: str, + app_name: str, + active_deployment_collection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AppResource]: + """Set existing Deployment under the app as active. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param active_deployment_collection: A list of Deployment name to be active. Required. + :type active_deployment_collection: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_set_active_deployments( + self, + resource_group_name: str, + service_name: str, + app_name: str, + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AppResource]: + """Set existing Deployment under the app as active. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param active_deployment_collection: A list of Deployment name to be active. Is either a + ActiveDeploymentCollection type or a IO[bytes] type. Required. + :type active_deployment_collection: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ActiveDeploymentCollection or IO[bytes] + :return: An instance of AsyncLROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._set_active_deployments_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + active_deployment_collection=active_deployment_collection, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AppResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AppResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def validate_domain( + self, + resource_group_name: str, + service_name: str, + app_name: str, + validate_payload: _models.CustomDomainValidatePayload, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the resource name is valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param validate_payload: Custom domain payload to be validated. Required. + :type validate_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidatePayload + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate_domain( + self, + resource_group_name: str, + service_name: str, + app_name: str, + validate_payload: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the resource name is valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param validate_payload: Custom domain payload to be validated. Required. + :type validate_payload: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def validate_domain( + self, + resource_group_name: str, + service_name: str, + app_name: str, + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the resource name is valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param validate_payload: Custom domain payload to be validated. Is either a + CustomDomainValidatePayload type or a IO[bytes] type. Required. + :type validate_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomDomainValidateResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(validate_payload, (IOBase, bytes)): + _content = validate_payload + else: + _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") + + _request = build_validate_domain_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_bindings_operations.py new file mode 100644 index 00000000000..3c917bab550 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_bindings_operations.py @@ -0,0 +1,778 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._bindings_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class BindingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`bindings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any + ) -> _models.BindingResource: + """Get a Binding and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :return: BindingResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BindingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: Union[_models.BindingResource, IO[bytes]], + **kwargs: Any + ) -> _models.BindingResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(binding_resource, (IOBase, bytes)): + _content = binding_resource + else: + _json = self._serialize.body(binding_resource, "BindingResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BindingResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BindingResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("BindingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: _models.BindingResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BindingResource]: + """Create a new Binding or update an exiting Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :param binding_resource: Parameters for the create or update operation. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BindingResource]: + """Create a new Binding or update an exiting Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :param binding_resource: Parameters for the create or update operation. Required. + :type binding_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: Union[_models.BindingResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BindingResource]: + """Create a new Binding or update an exiting Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :param binding_resource: Parameters for the create or update operation. Is either a + BindingResource type or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either BindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + binding_resource=binding_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BindingResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BindingResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Operation to delete a Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: Union[_models.BindingResource, IO[bytes]], + **kwargs: Any + ) -> _models.BindingResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(binding_resource, (IOBase, bytes)): + _content = binding_resource + else: + _json = self._serialize.body(binding_resource, "BindingResource") + + _request = build_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BindingResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("BindingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: _models.BindingResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BindingResource]: + """Operation to update an exiting Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :param binding_resource: Parameters for the update operation. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BindingResource]: + """Operation to update an exiting Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :param binding_resource: Parameters for the update operation. Required. + :type binding_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: Union[_models.BindingResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BindingResource]: + """Operation to update an exiting Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :param binding_resource: Parameters for the update operation. Is either a BindingResource type + or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either BindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + binding_resource=binding_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BindingResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BindingResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any + ) -> AsyncIterable["_models.BindingResource"]: + """Handles requests to list all resources in an App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :return: An iterator like instance of either BindingResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BindingResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BindingResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_build_service_agent_pool_operations.py new file mode 100644 index 00000000000..cc79c579ab4 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_build_service_agent_pool_operations.py @@ -0,0 +1,444 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._build_service_agent_pool_operations import ( + build_get_request, + build_list_request, + build_update_put_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class BuildServiceAgentPoolOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`build_service_agent_pool` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.BuildServiceAgentPoolResource"]: + """List build service agent pool. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildServiceAgentPoolResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any + ) -> _models.BuildServiceAgentPoolResource: + """Get build service agent pool. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param agent_pool_name: The name of the build service agent pool resource. Required. + :type agent_pool_name: str + :return: BuildServiceAgentPoolResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _update_put_initial( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + agent_pool_name: str, + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], + **kwargs: Any + ) -> _models.BuildServiceAgentPoolResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(agent_pool_resource, (IOBase, bytes)): + _content = agent_pool_resource + else: + _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") + + _request = build_update_put_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + agent_pool_name: str, + agent_pool_resource: _models.BuildServiceAgentPoolResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: + """Create or update build service agent pool. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param agent_pool_name: The name of the build service agent pool resource. Required. + :type agent_pool_name: str + :param agent_pool_resource: Parameters for the update operation. Required. + :type agent_pool_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + agent_pool_name: str, + agent_pool_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: + """Create or update build service agent pool. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param agent_pool_name: The name of the build service agent pool resource. Required. + :type agent_pool_name: str + :param agent_pool_resource: Parameters for the update operation. Required. + :type agent_pool_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + agent_pool_name: str, + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BuildServiceAgentPoolResource]: + """Create or update build service agent pool. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param agent_pool_name: The name of the build service agent pool resource. Required. + :type agent_pool_name: str + :param agent_pool_resource: Parameters for the update operation. Is either a + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. + :type agent_pool_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either BuildServiceAgentPoolResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_put_initial( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + agent_pool_name=agent_pool_name, + agent_pool_resource=agent_pool_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_build_service_builder_operations.py new file mode 100644 index 00000000000..838293c7507 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_build_service_builder_operations.py @@ -0,0 +1,618 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._build_service_builder_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_deployments_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class BuildServiceBuilderOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`build_service_builder` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any + ) -> _models.BuilderResource: + """Get a KPack builder. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :return: BuilderResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BuilderResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + builder_resource: Union[_models.BuilderResource, IO[bytes]], + **kwargs: Any + ) -> _models.BuilderResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(builder_resource, (IOBase, bytes)): + _content = builder_resource + else: + _json = self._serialize.body(builder_resource, "BuilderResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BuilderResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BuilderResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + builder_resource: _models.BuilderResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BuilderResource]: + """Create or update a KPack builder. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param builder_resource: The target builder for the create or update operation. Required. + :type builder_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + builder_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BuilderResource]: + """Create or update a KPack builder. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param builder_resource: The target builder for the create or update operation. Required. + :type builder_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + builder_resource: Union[_models.BuilderResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BuilderResource]: + """Create or update a KPack builder. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param builder_resource: The target builder for the create or update operation. Is either a + BuilderResource type or a IO[bytes] type. Required. + :type builder_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + builder_resource=builder_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BuilderResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BuilderResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a KPack builder. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.BuilderResource"]: + """List KPack builders result. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :return: An iterator like instance of either BuilderResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuilderResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def list_deployments( + self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any + ) -> _models.DeploymentList: + """List deployments that are using the builder. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :return: DeploymentList or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) + + _request = build_list_deployments_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DeploymentList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_build_service_operations.py new file mode 100644 index 00000000000..fa901beba26 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_build_service_operations.py @@ -0,0 +1,1431 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._build_service_operations import ( + build_create_or_update_build_request, + build_create_or_update_request, + build_delete_build_request, + build_get_build_request, + build_get_build_result_log_request, + build_get_build_result_request, + build_get_build_service_request, + build_get_resource_upload_url_request, + build_get_supported_buildpack_request, + build_get_supported_stack_request, + build_list_build_results_request, + build_list_build_services_request, + build_list_builds_request, + build_list_supported_buildpacks_request, + build_list_supported_stacks_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class BuildServiceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`build_service` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list_build_services( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.BuildService"]: + """List build services resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either BuildService or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildServiceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_build_services_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BuildServiceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_build_service( + self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any + ) -> _models.BuildService: + """Get a build service resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :return: BuildService or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) + + _request = build_get_build_service_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BuildService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_service: Union[_models.BuildService, IO[bytes]], + **kwargs: Any + ) -> _models.BuildService: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(build_service, (IOBase, bytes)): + _content = build_service + else: + _json = self._serialize.body(build_service, "BuildService") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BuildService", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BuildService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_service: _models.BuildService, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BuildService]: + """Create a build service resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_service: Parameters for the create operation. Required. + :type build_service: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BuildService or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_service: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BuildService]: + """Create a build service resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_service: Parameters for the create operation. Required. + :type build_service: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BuildService or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_service: Union[_models.BuildService, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BuildService]: + """Create a build service resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_service: Parameters for the create operation. Is either a BuildService type or a + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either BuildService or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_service=build_service, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BuildService", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BuildService].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_builds( + self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.Build"]: + """List KPack builds. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :return: An iterator like instance of either Build or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.Build] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_builds_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BuildCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_build( + self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any + ) -> _models.Build: + """Get a KPack build. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :return: Build or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Build + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.Build] = kwargs.pop("cls", None) + + _request = build_get_build_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_name=build_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Build", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update_build( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + build: _models.Build, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Build: + """Create or update a KPack build. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :param build: Parameters for the create or update operation. Required. + :type build: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Build + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Build or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Build + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update_build( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + build: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Build: + """Create or update a KPack build. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :param build: Parameters for the create or update operation. Required. + :type build: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Build or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Build + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update_build( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + build: Union[_models.Build, IO[bytes]], + **kwargs: Any + ) -> _models.Build: + """Create or update a KPack build. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Build or IO[bytes] + :return: Build or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Build + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Build] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(build, (IOBase, bytes)): + _content = build + else: + _json = self._serialize.body(build, "Build") + + _request = build_create_or_update_build_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_name=build_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Build", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Build", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_build_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_build_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_name=build_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete_build( + self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """delete a KPack build. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_build_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_name=build_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_build_results( + self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any + ) -> AsyncIterable["_models.BuildResult"]: + """List KPack build results. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :return: An iterator like instance of either BuildResult or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildResultCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_build_results_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_name=build_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BuildResultCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_build_result( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + build_result_name: str, + **kwargs: Any + ) -> _models.BuildResult: + """Get a KPack build result. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :param build_result_name: The name of the build result resource. Required. + :type build_result_name: str + :return: BuildResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) + + _request = build_get_build_result_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_name=build_name, + build_result_name=build_result_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BuildResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_build_result_log( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + build_result_name: str, + **kwargs: Any + ) -> _models.BuildResultLog: + """Get a KPack build result log download URL. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :param build_result_name: The name of the build result resource. Required. + :type build_result_name: str + :return: BuildResultLog or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildResultLog + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) + + _request = build_get_build_result_log_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_name=build_name, + build_result_name=build_result_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BuildResultLog", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_resource_upload_url( + self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any + ) -> _models.ResourceUploadDefinition: + """Get an resource upload URL for build service, which may be artifacts or source archive. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :return: ResourceUploadDefinition or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceUploadDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) + + _request = build_get_resource_upload_url_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_supported_buildpacks( + self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any + ) -> _models.SupportedBuildpacksCollection: + """Get all supported buildpacks. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :return: SupportedBuildpacksCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedBuildpacksCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) + + _request = build_list_supported_buildpacks_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_supported_buildpack( + self, resource_group_name: str, service_name: str, build_service_name: str, buildpack_name: str, **kwargs: Any + ) -> _models.SupportedBuildpackResource: + """Get the supported buildpack resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param buildpack_name: The name of the buildpack resource. Required. + :type buildpack_name: str + :return: SupportedBuildpackResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedBuildpackResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) + + _request = build_get_supported_buildpack_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + buildpack_name=buildpack_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_supported_stacks( + self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any + ) -> _models.SupportedStacksCollection: + """Get all supported stacks. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :return: SupportedStacksCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedStacksCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) + + _request = build_list_supported_stacks_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_supported_stack( + self, resource_group_name: str, service_name: str, build_service_name: str, stack_name: str, **kwargs: Any + ) -> _models.SupportedStackResource: + """Get the supported stack resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param stack_name: The name of the stack resource. Required. + :type stack_name: str + :return: SupportedStackResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedStackResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) + + _request = build_get_supported_stack_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + stack_name=stack_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SupportedStackResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_buildpack_binding_operations.py new file mode 100644 index 00000000000..59a2e23caf7 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_buildpack_binding_operations.py @@ -0,0 +1,685 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._buildpack_binding_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_for_cluster_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class BuildpackBindingOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`buildpack_binding` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list_for_cluster( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.BuildpackBindingResource"]: + """Get collection of buildpack bindings under all builders. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either BuildpackBindingResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildpackBindingResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_for_cluster_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + **kwargs: Any + ) -> _models.BuildpackBindingResource: + """Get a buildpack binding by name. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. + :type buildpack_binding_name: str + :return: BuildpackBindingResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + buildpack_binding_name=buildpack_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], + **kwargs: Any + ) -> _models.BuildpackBindingResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(buildpack_binding, (IOBase, bytes)): + _content = buildpack_binding + else: + _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + buildpack_binding_name=buildpack_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + buildpack_binding: _models.BuildpackBindingResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BuildpackBindingResource]: + """Create or update a buildpack binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. + :type buildpack_binding_name: str + :param buildpack_binding: The target buildpack binding for the create or update operation. + Required. + :type buildpack_binding: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + buildpack_binding: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BuildpackBindingResource]: + """Create or update a buildpack binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. + :type buildpack_binding_name: str + :param buildpack_binding: The target buildpack binding for the create or update operation. + Required. + :type buildpack_binding: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BuildpackBindingResource]: + """Create or update a buildpack binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. + :type buildpack_binding_name: str + :param buildpack_binding: The target buildpack binding for the create or update operation. Is + either a BuildpackBindingResource type or a IO[bytes] type. Required. + :type buildpack_binding: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either BuildpackBindingResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + buildpack_binding_name=buildpack_binding_name, + buildpack_binding=buildpack_binding, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BuildpackBindingResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + buildpack_binding_name=buildpack_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Operation to delete a Buildpack Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. + :type buildpack_binding_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + buildpack_binding_name=buildpack_binding_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any + ) -> AsyncIterable["_models.BuildpackBindingResource"]: + """Handles requests to list all buildpack bindings in a builder. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :return: An iterator like instance of either BuildpackBindingResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildpackBindingResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_certificates_operations.py new file mode 100644 index 00000000000..645a4d02d90 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_certificates_operations.py @@ -0,0 +1,533 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._certificates_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class CertificatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`certificates` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any + ) -> _models.CertificateResource: + """Get the certificate resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param certificate_name: The name of the certificate resource. Required. + :type certificate_name: str + :return: CertificateResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + certificate_name=certificate_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CertificateResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + certificate_name: str, + certificate_resource: Union[_models.CertificateResource, IO[bytes]], + **kwargs: Any + ) -> _models.CertificateResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(certificate_resource, (IOBase, bytes)): + _content = certificate_resource + else: + _json = self._serialize.body(certificate_resource, "CertificateResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + certificate_name=certificate_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("CertificateResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("CertificateResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("CertificateResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + certificate_name: str, + certificate_resource: _models.CertificateResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CertificateResource]: + """Create or update certificate resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param certificate_name: The name of the certificate resource. Required. + :type certificate_name: str + :param certificate_resource: Parameters for the create or update operation. Required. + :type certificate_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + certificate_name: str, + certificate_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CertificateResource]: + """Create or update certificate resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param certificate_name: The name of the certificate resource. Required. + :type certificate_name: str + :param certificate_resource: Parameters for the create or update operation. Required. + :type certificate_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + certificate_name: str, + certificate_resource: Union[_models.CertificateResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CertificateResource]: + """Create or update certificate resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param certificate_name: The name of the certificate resource. Required. + :type certificate_name: str + :param certificate_resource: Parameters for the create or update operation. Is either a + CertificateResource type or a IO[bytes] type. Required. + :type certificate_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either CertificateResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + certificate_name=certificate_name, + certificate_resource=certificate_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CertificateResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CertificateResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + certificate_name=certificate_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete the certificate resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param certificate_name: The name of the certificate resource. Required. + :type certificate_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + certificate_name=certificate_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.CertificateResource"]: + """List all the certificates of one user. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either CertificateResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.CertificateResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_config_servers_operations.py new file mode 100644 index 00000000000..47cdf936ce7 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_config_servers_operations.py @@ -0,0 +1,916 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._config_servers_operations import ( + build_delete_request, + build_get_request, + build_list_request, + build_update_patch_request, + build_update_put_request, + build_validate_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ConfigServersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`config_servers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.ConfigServerResource: + """Get the config server and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: ConfigServerResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConfigServerResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _update_put_initial( + self, + resource_group_name: str, + service_name: str, + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], + **kwargs: Any + ) -> _models.ConfigServerResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(config_server_resource, (IOBase, bytes)): + _content = config_server_resource + else: + _json = self._serialize.body(config_server_resource, "ConfigServerResource") + + _request = build_update_put_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConfigServerResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ConfigServerResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + config_server_resource: _models.ConfigServerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigServerResource]: + """Update the config server. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_resource: Parameters for the update operation. Required. + :type config_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + config_server_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigServerResource]: + """Update the config server. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_resource: Parameters for the update operation. Required. + :type config_server_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigServerResource]: + """Update the config server. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_resource: Parameters for the update operation. Is either a + ConfigServerResource type or a IO[bytes] type. Required. + :type config_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_put_initial( + resource_group_name=resource_group_name, + service_name=service_name, + config_server_resource=config_server_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigServerResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_patch_initial( + self, + resource_group_name: str, + service_name: str, + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], + **kwargs: Any + ) -> _models.ConfigServerResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(config_server_resource, (IOBase, bytes)): + _content = config_server_resource + else: + _json = self._serialize.body(config_server_resource, "ConfigServerResource") + + _request = build_update_patch_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConfigServerResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ConfigServerResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + config_server_resource: _models.ConfigServerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigServerResource]: + """Update the config server. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_resource: Parameters for the update operation. Required. + :type config_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + config_server_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigServerResource]: + """Update the config server. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_resource: Parameters for the update operation. Required. + :type config_server_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigServerResource]: + """Update the config server. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_resource: Parameters for the update operation. Is either a + ConfigServerResource type or a IO[bytes] type. Required. + :type config_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_patch_initial( + resource_group_name=resource_group_name, + service_name=service_name, + config_server_resource=config_server_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigServerResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Disable the default Config Server, only available in Enterprise Plan. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ConfigServerResource"]: + """Handles requests to list all config server resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ConfigServerResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ConfigServerResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ConfigServerResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _validate_initial( + self, + resource_group_name: str, + service_name: str, + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], + **kwargs: Any + ) -> _models.ConfigServerSettingsValidateResult: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigServerSettingsValidateResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(config_server_settings, (IOBase, bytes)): + _content = config_server_settings + else: + _json = self._serialize.body(config_server_settings, "ConfigServerSettings") + + _request = build_validate_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_validate( + self, + resource_group_name: str, + service_name: str, + config_server_settings: _models.ConfigServerSettings, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: + """Check if the config server settings are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_settings: Config server settings to be validated. Required. + :type config_server_settings: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerSettings + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_validate( + self, + resource_group_name: str, + service_name: str, + config_server_settings: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: + """Check if the config server settings are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_settings: Config server settings to be validated. Required. + :type config_server_settings: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_validate( + self, + resource_group_name: str, + service_name: str, + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]: + """Check if the config server settings are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_settings: Config server settings to be validated. Is either a + ConfigServerSettings type or a IO[bytes] type. Required. + :type config_server_settings: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerSettings or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigServerSettingsValidateResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._validate_initial( + resource_group_name=resource_group_name, + service_name=service_name, + config_server_settings=config_server_settings, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_configuration_services_operations.py new file mode 100644 index 00000000000..b84841364b7 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_configuration_services_operations.py @@ -0,0 +1,967 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._configuration_services_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_validate_request, + build_validate_resource_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ConfigurationServicesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`configuration_services` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any + ) -> _models.ConfigurationServiceResource: + """Get the Application Configuration Service and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :return: ConfigurationServiceResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], + **kwargs: Any + ) -> _models.ConfigurationServiceResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(configuration_service_resource, (IOBase, bytes)): + _content = configuration_service_resource + else: + _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: _models.ConfigurationServiceResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: + """Create the default Application Configuration Service or update the existing Application + Configuration Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param configuration_service_resource: Parameters for the update operation. Required. + :type configuration_service_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: + """Create the default Application Configuration Service or update the existing Application + Configuration Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param configuration_service_resource: Parameters for the update operation. Required. + :type configuration_service_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationServiceResource]: + """Create the default Application Configuration Service or update the existing Application + Configuration Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param configuration_service_resource: Parameters for the update operation. Is either a + ConfigurationServiceResource type or a IO[bytes] type. Required. + :type configuration_service_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ConfigurationServiceResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + configuration_service_resource=configuration_service_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConfigurationServiceResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disable the default Application Configuration Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ConfigurationServiceResource"]: + """Handles requests to list all resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ConfigurationServiceResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ConfigurationServiceResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _validate_initial( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], + **kwargs: Any + ) -> _models.ConfigurationServiceSettingsValidateResult: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationServiceSettingsValidateResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(settings, (IOBase, bytes)): + _content = settings + else: + _json = self._serialize.body(settings, "ConfigurationServiceSettings") + + _request = build_validate_request( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_validate( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + settings: _models.ConfigurationServiceSettings, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: + """Check if the Application Configuration Service settings are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param settings: Application Configuration Service settings to be validated. Required. + :type settings: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettings + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either + ConfigurationServiceSettingsValidateResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_validate( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + settings: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: + """Check if the Application Configuration Service settings are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param settings: Application Configuration Service settings to be validated. Required. + :type settings: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either + ConfigurationServiceSettingsValidateResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_validate( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: + """Check if the Application Configuration Service settings are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param settings: Application Configuration Service settings to be validated. Is either a + ConfigurationServiceSettings type or a IO[bytes] type. Required. + :type settings: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettings + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either + ConfigurationServiceSettingsValidateResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationServiceSettingsValidateResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._validate_initial( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + settings=settings, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _validate_resource_initial( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ConfigurationServiceSettingsValidateResult]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ConfigurationServiceSettingsValidateResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(configuration_service_resource, (IOBase, bytes)): + _content = configuration_service_resource + else: + _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") + + _request = build_validate_resource_request( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_validate_resource( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: _models.ConfigurationServiceResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: + """Check if the Application Configuration Service resource is valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param configuration_service_resource: Application Configuration Service resource to be + validated. Required. + :type configuration_service_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either + ConfigurationServiceSettingsValidateResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_validate_resource( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: + """Check if the Application Configuration Service resource is valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param configuration_service_resource: Application Configuration Service resource to be + validated. Required. + :type configuration_service_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either + ConfigurationServiceSettingsValidateResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_validate_resource( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]: + """Check if the Application Configuration Service resource is valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param configuration_service_resource: Application Configuration Service resource to be + validated. Is either a ConfigurationServiceResource type or a IO[bytes] type. Required. + :type configuration_service_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either + ConfigurationServiceSettingsValidateResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationServiceSettingsValidateResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._validate_resource_initial( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + configuration_service_resource=configuration_service_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_container_registries_operations.py new file mode 100644 index 00000000000..7eaed0b24c5 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_container_registries_operations.py @@ -0,0 +1,756 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._container_registries_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_validate_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ContainerRegistriesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`container_registries` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ContainerRegistryResource"]: + """List container registries resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ContainerRegistryResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ContainerRegistryResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any + ) -> _models.ContainerRegistryResource: + """Get the container registries resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :return: ContainerRegistryResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + container_registry_name=container_registry_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], + **kwargs: Any + ) -> _models.ContainerRegistryResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(container_registry_resource, (IOBase, bytes)): + _content = container_registry_resource + else: + _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + container_registry_name=container_registry_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_resource: _models.ContainerRegistryResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ContainerRegistryResource]: + """Create or update container registry resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :param container_registry_resource: Parameters for the create or update operation. Required. + :type container_registry_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ContainerRegistryResource]: + """Create or update container registry resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :param container_registry_resource: Parameters for the create or update operation. Required. + :type container_registry_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ContainerRegistryResource]: + """Create or update container registry resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :param container_registry_resource: Parameters for the create or update operation. Is either a + ContainerRegistryResource type or a IO[bytes] type. Required. + :type container_registry_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + container_registry_name=container_registry_name, + container_registry_resource=container_registry_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ContainerRegistryResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + container_registry_name=container_registry_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a container registry resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + container_registry_name=container_registry_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _validate_initial( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ContainerRegistryValidateResult]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ContainerRegistryValidateResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(container_registry_properties, (IOBase, bytes)): + _content = container_registry_properties + else: + _json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties") + + _request = build_validate_request( + resource_group_name=resource_group_name, + service_name=service_name, + container_registry_name=container_registry_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_validate( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_properties: _models.ContainerRegistryProperties, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]: + """Check if the container registry properties are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :param container_registry_properties: Parameters for the validate operation. Required. + :type container_registry_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryProperties + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_validate( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]: + """Check if the container registry properties are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :param container_registry_properties: Parameters for the validate operation. Required. + :type container_registry_properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_validate( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]: + """Check if the container registry properties are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :param container_registry_properties: Parameters for the validate operation. Is either a + ContainerRegistryProperties type or a IO[bytes] type. Required. + :type container_registry_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryProperties or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ContainerRegistryValidateResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._validate_initial( + resource_group_name=resource_group_name, + service_name=service_name, + container_registry_name=container_registry_name, + container_registry_properties=container_registry_properties, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ContainerRegistryValidateResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ContainerRegistryValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_custom_domains_operations.py new file mode 100644 index 00000000000..61ada6c5f54 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_custom_domains_operations.py @@ -0,0 +1,779 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._custom_domains_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class CustomDomainsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`custom_domains` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any + ) -> _models.CustomDomainResource: + """Get the custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :return: CustomDomainResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> _models.CustomDomainResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(domain_resource, (IOBase, bytes)): + _content = domain_resource + else: + _json = self._serialize.body(domain_resource, "CustomDomainResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: _models.CustomDomainResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomDomainResource]: + """Create or update custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :param domain_resource: Parameters for the create or update operation. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomDomainResource]: + """Create or update custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :param domain_resource: Parameters for the create or update operation. Required. + :type domain_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomDomainResource]: + """Create or update custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :param domain_resource: Parameters for the create or update operation. Is either a + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + domain_resource=domain_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete the custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> _models.CustomDomainResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(domain_resource, (IOBase, bytes)): + _content = domain_resource + else: + _json = self._serialize.body(domain_resource, "CustomDomainResource") + + _request = build_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: _models.CustomDomainResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomDomainResource]: + """Update custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :param domain_resource: Parameters for the create or update operation. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomDomainResource]: + """Update custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :param domain_resource: Parameters for the create or update operation. Required. + :type domain_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomDomainResource]: + """Update custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :param domain_resource: Parameters for the create or update operation. Is either a + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + domain_resource=domain_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any + ) -> AsyncIterable["_models.CustomDomainResource"]: + """List the custom domains of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :return: An iterator like instance of either CustomDomainResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.CustomDomainResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_customized_accelerators_operations.py new file mode 100644 index 00000000000..b3023c8389f --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_customized_accelerators_operations.py @@ -0,0 +1,801 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._customized_accelerators_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_validate_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class CustomizedAcceleratorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`customized_accelerators` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any + ) -> AsyncIterable["_models.CustomizedAcceleratorResource"]: + """Handle requests to list all customized accelerators. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :return: An iterator like instance of either CustomizedAcceleratorResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.CustomizedAcceleratorResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + **kwargs: Any + ) -> _models.CustomizedAcceleratorResource: + """Get the customized accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :return: CustomizedAcceleratorResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + customized_accelerator_name=customized_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], + **kwargs: Any + ) -> _models.CustomizedAcceleratorResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(customized_accelerator_resource, (IOBase, bytes)): + _content = customized_accelerator_resource + else: + _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + customized_accelerator_name=customized_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + customized_accelerator_resource: _models.CustomizedAcceleratorResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]: + """Create or update the customized accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :param customized_accelerator_resource: The customized accelerator for the create or update + operation. Required. + :type customized_accelerator_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + customized_accelerator_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]: + """Create or update the customized accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :param customized_accelerator_resource: The customized accelerator for the create or update + operation. Required. + :type customized_accelerator_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]: + """Create or update the customized accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :param customized_accelerator_resource: The customized accelerator for the create or update + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. + :type customized_accelerator_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + customized_accelerator_name=customized_accelerator_name, + customized_accelerator_resource=customized_accelerator_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + customized_accelerator_name=customized_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete the customized accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + customized_accelerator_name=customized_accelerator_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _validate_initial( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.CustomizedAcceleratorValidateResult]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CustomizedAcceleratorValidateResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") + + _request = build_validate_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + customized_accelerator_name=customized_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_validate( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + properties: _models.CustomizedAcceleratorProperties, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomizedAcceleratorValidateResult]: + """Check the customized accelerator are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :param properties: Customized accelerator properties to be validated. Required. + :type properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorProperties + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorValidateResult + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_validate( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomizedAcceleratorValidateResult]: + """Check the customized accelerator are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :param properties: Customized accelerator properties to be validated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorValidateResult + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_validate( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CustomizedAcceleratorValidateResult]: + """Check the customized accelerator are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :param properties: Customized accelerator properties to be validated. Is either a + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. + :type properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] + :return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorValidateResult + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomizedAcceleratorValidateResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._validate_initial( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + customized_accelerator_name=customized_accelerator_name, + properties=properties, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CustomizedAcceleratorValidateResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CustomizedAcceleratorValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_deployments_operations.py new file mode 100644 index 00000000000..3b042eb789a --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_deployments_operations.py @@ -0,0 +1,2327 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._deployments_operations import ( + build_create_or_update_request, + build_delete_request, + build_disable_remote_debugging_request, + build_enable_remote_debugging_request, + build_generate_heap_dump_request, + build_generate_thread_dump_request, + build_get_log_file_url_request, + build_get_remote_debugging_config_request, + build_get_request, + build_list_for_cluster_request, + build_list_request, + build_restart_request, + build_start_jfr_request, + build_start_request, + build_stop_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class DeploymentsOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`deployments` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> _models.DeploymentResource: + """Get a Deployment and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :return: DeploymentResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DeploymentResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], + **kwargs: Any + ) -> _models.DeploymentResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(deployment_resource, (IOBase, bytes)): + _content = deployment_resource + else: + _json = self._serialize.body(deployment_resource, "DeploymentResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DeploymentResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("DeploymentResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("DeploymentResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: _models.DeploymentResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DeploymentResource]: + """Create a new Deployment or update an exiting Deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param deployment_resource: Parameters for the create or update operation. Required. + :type deployment_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DeploymentResource]: + """Create a new Deployment or update an exiting Deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param deployment_resource: Parameters for the create or update operation. Required. + :type deployment_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DeploymentResource]: + """Create a new Deployment or update an exiting Deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param deployment_resource: Parameters for the create or update operation. Is either a + DeploymentResource type or a IO[bytes] type. Required. + :type deployment_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + deployment_resource=deployment_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DeploymentResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Operation to delete a Deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], + **kwargs: Any + ) -> _models.DeploymentResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(deployment_resource, (IOBase, bytes)): + _content = deployment_resource + else: + _json = self._serialize.body(deployment_resource, "DeploymentResource") + + _request = build_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DeploymentResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("DeploymentResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: _models.DeploymentResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DeploymentResource]: + """Operation to update an exiting Deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param deployment_resource: Parameters for the update operation. Required. + :type deployment_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DeploymentResource]: + """Operation to update an exiting Deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param deployment_resource: Parameters for the update operation. Required. + :type deployment_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DeploymentResource]: + """Operation to update an exiting Deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource + type or a IO[bytes] type. Required. + :type deployment_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + deployment_resource=deployment_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DeploymentResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DeploymentResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, + resource_group_name: str, + service_name: str, + app_name: str, + version: Optional[List[str]] = None, + expand: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.DeploymentResource"]: + """Handles requests to list all resources in an App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param version: Version of the deployments to be listed. Default value is None. + :type version: list[str] + :param expand: The expand expression to apply on the operation. Default value is None. + :type expand: str + :return: An iterator like instance of either DeploymentResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.DeploymentResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + version=version, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_for_cluster( + self, + resource_group_name: str, + service_name: str, + version: Optional[List[str]] = None, + expand: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.DeploymentResource"]: + """List deployments for a certain service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param version: Version of the deployments to be listed. Default value is None. + :type version: list[str] + :param expand: The expand expression to apply on the operation. Default value is None. + :type expand: str + :return: An iterator like instance of either DeploymentResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.DeploymentResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_for_cluster_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + version=version, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_start_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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, {}) # type: ignore + + @distributed_trace_async + async def begin_start( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Start the deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_stop_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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, {}) # type: ignore + + @distributed_trace_async + async def begin_stop( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Stop the deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _restart_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_restart_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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, {}) # type: ignore + + @distributed_trace_async + async def begin_restart( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Restart the deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._restart_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _enable_remote_debugging_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, + **kwargs: Any + ) -> _models.RemoteDebugging: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(remote_debugging_payload, (IOBase, bytes)): + _content = remote_debugging_payload + else: + if remote_debugging_payload is not None: + _json = self._serialize.body(remote_debugging_payload, "RemoteDebuggingPayload") + else: + _json = None + + _request = build_enable_remote_debugging_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RemoteDebugging", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("RemoteDebugging", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_enable_remote_debugging( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + remote_debugging_payload: Optional[_models.RemoteDebuggingPayload] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RemoteDebugging]: + """Enable remote debugging. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. + :type remote_debugging_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.RemoteDebuggingPayload + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.RemoteDebugging] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_enable_remote_debugging( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + remote_debugging_payload: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RemoteDebugging]: + """Enable remote debugging. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. + :type remote_debugging_payload: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.RemoteDebugging] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_enable_remote_debugging( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.RemoteDebugging]: + """Enable remote debugging. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param remote_debugging_payload: Parameters for enable remote debugging. Is either a + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. + :type remote_debugging_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.RemoteDebuggingPayload or IO[bytes] + :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.RemoteDebugging] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._enable_remote_debugging_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + remote_debugging_payload=remote_debugging_payload, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RemoteDebugging", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _disable_remote_debugging_initial( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> _models.RemoteDebugging: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) + + _request = build_disable_remote_debugging_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RemoteDebugging", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("RemoteDebugging", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_disable_remote_debugging( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.RemoteDebugging]: + """Disable remote debugging. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.RemoteDebugging] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._disable_remote_debugging_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RemoteDebugging", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get_remote_debugging_config( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> _models.RemoteDebugging: + """Get remote debugging config. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :return: RemoteDebugging or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.RemoteDebugging + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) + + _request = build_get_remote_debugging_config_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RemoteDebugging", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_log_file_url( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> Optional[_models.LogFileUrlResponse]: + """Get deployment log file URL. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :return: LogFileUrlResponse or None or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.LogFileUrlResponse or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) + + _request = build_get_log_file_url_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(diagnostic_parameters, (IOBase, bytes)): + _content = diagnostic_parameters + else: + _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") + + _request = build_generate_heap_dump_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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, {}) # type: ignore + + @overload + async def begin_generate_heap_dump( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: _models.DiagnosticParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Generate Heap Dump. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Required. + :type diagnostic_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DiagnosticParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + async def begin_generate_heap_dump( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Generate Heap Dump. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Required. + :type diagnostic_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace_async + async def begin_generate_heap_dump( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Generate Heap Dump. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a + DiagnosticParameters type or a IO[bytes] type. Required. + :type diagnostic_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DiagnosticParameters or IO[bytes] + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._generate_heap_dump_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + diagnostic_parameters=diagnostic_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(diagnostic_parameters, (IOBase, bytes)): + _content = diagnostic_parameters + else: + _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") + + _request = build_generate_thread_dump_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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, {}) # type: ignore + + @overload + async def begin_generate_thread_dump( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: _models.DiagnosticParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Generate Thread Dump. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Required. + :type diagnostic_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DiagnosticParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + async def begin_generate_thread_dump( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Generate Thread Dump. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Required. + :type diagnostic_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace_async + async def begin_generate_thread_dump( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Generate Thread Dump. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a + DiagnosticParameters type or a IO[bytes] type. Required. + :type diagnostic_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DiagnosticParameters or IO[bytes] + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._generate_thread_dump_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + diagnostic_parameters=diagnostic_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(diagnostic_parameters, (IOBase, bytes)): + _content = diagnostic_parameters + else: + _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") + + _request = build_start_jfr_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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, {}) # type: ignore + + @overload + async def begin_start_jfr( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: _models.DiagnosticParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Start JFR. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Required. + :type diagnostic_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DiagnosticParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + async def begin_start_jfr( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Start JFR. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Required. + :type diagnostic_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace_async + async def begin_start_jfr( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Start JFR. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a + DiagnosticParameters type or a IO[bytes] type. Required. + :type diagnostic_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DiagnosticParameters or IO[bytes] + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_jfr_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + diagnostic_parameters=diagnostic_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_dev_tool_portals_operations.py new file mode 100644 index 00000000000..52ba1af9d13 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_dev_tool_portals_operations.py @@ -0,0 +1,535 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._dev_tool_portals_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class DevToolPortalsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`dev_tool_portals` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.DevToolPortalResource"]: + """Handles requests to list all resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either DevToolPortalResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.DevToolPortalResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any + ) -> _models.DevToolPortalResource: + """Get the Application Live and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param dev_tool_portal_name: The name of Dev Tool Portal. Required. + :type dev_tool_portal_name: str + :return: DevToolPortalResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + dev_tool_portal_name=dev_tool_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DevToolPortalResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + dev_tool_portal_name: str, + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], + **kwargs: Any + ) -> _models.DevToolPortalResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(dev_tool_portal_resource, (IOBase, bytes)): + _content = dev_tool_portal_resource + else: + _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + dev_tool_portal_name=dev_tool_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DevToolPortalResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("DevToolPortalResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + dev_tool_portal_name: str, + dev_tool_portal_resource: _models.DevToolPortalResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DevToolPortalResource]: + """Create the default Dev Tool Portal or update the existing Dev Tool Portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param dev_tool_portal_name: The name of Dev Tool Portal. Required. + :type dev_tool_portal_name: str + :param dev_tool_portal_resource: Parameters for the create or update operation. Required. + :type dev_tool_portal_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + dev_tool_portal_name: str, + dev_tool_portal_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DevToolPortalResource]: + """Create the default Dev Tool Portal or update the existing Dev Tool Portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param dev_tool_portal_name: The name of Dev Tool Portal. Required. + :type dev_tool_portal_name: str + :param dev_tool_portal_resource: Parameters for the create or update operation. Required. + :type dev_tool_portal_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + dev_tool_portal_name: str, + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DevToolPortalResource]: + """Create the default Dev Tool Portal or update the existing Dev Tool Portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param dev_tool_portal_name: The name of Dev Tool Portal. Required. + :type dev_tool_portal_name: str + :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a + DevToolPortalResource type or a IO[bytes] type. Required. + :type dev_tool_portal_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + dev_tool_portal_name=dev_tool_portal_name, + dev_tool_portal_resource=dev_tool_portal_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DevToolPortalResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DevToolPortalResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + dev_tool_portal_name=dev_tool_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disable the default Dev Tool Portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param dev_tool_portal_name: The name of Dev Tool Portal. Required. + :type dev_tool_portal_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + dev_tool_portal_name=dev_tool_portal_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_eureka_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_eureka_servers_operations.py new file mode 100644 index 00000000000..4f0e2562b6b --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_eureka_servers_operations.py @@ -0,0 +1,589 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._eureka_servers_operations import ( + build_get_request, + build_list_request, + build_update_patch_request, + build_update_put_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class EurekaServersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`eureka_servers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> _models.EurekaServerResourceCollection: + """List the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: EurekaServerResourceCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResourceCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.EurekaServerResourceCollection] = kwargs.pop("cls", None) + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EurekaServerResourceCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.EurekaServerResource: + """Get the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: EurekaServerResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EurekaServerResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _update_put_initial( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], + **kwargs: Any + ) -> _models.EurekaServerResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(eureka_server_resource, (IOBase, bytes)): + _content = eureka_server_resource + else: + _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") + + _request = build_update_put_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("EurekaServerResource", pipeline_response) + + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("EurekaServerResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: _models.EurekaServerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Is either a + EurekaServerResource type or a IO[bytes] type. Required. + :type eureka_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_put_initial( + resource_group_name=resource_group_name, + service_name=service_name, + eureka_server_resource=eureka_server_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EurekaServerResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EurekaServerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_patch_initial( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], + **kwargs: Any + ) -> _models.EurekaServerResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(eureka_server_resource, (IOBase, bytes)): + _content = eureka_server_resource + else: + _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") + + _request = build_update_patch_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("EurekaServerResource", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("EurekaServerResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: _models.EurekaServerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Is either a + EurekaServerResource type or a IO[bytes] type. Required. + :type eureka_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_patch_initial( + resource_group_name=resource_group_name, + service_name=service_name, + eureka_server_resource=eureka_server_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EurekaServerResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EurekaServerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_gateway_custom_domains_operations.py new file mode 100644 index 00000000000..428bb6f090b --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_gateway_custom_domains_operations.py @@ -0,0 +1,555 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._gateway_custom_domains_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class GatewayCustomDomainsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`gateway_custom_domains` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any + ) -> _models.GatewayCustomDomainResource: + """Get the Spring Cloud Gateway custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. + :type domain_name: str + :return: GatewayCustomDomainResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + domain_name: str, + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> _models.GatewayCustomDomainResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(gateway_custom_domain_resource, (IOBase, bytes)): + _content = gateway_custom_domain_resource + else: + _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + domain_name: str, + gateway_custom_domain_resource: _models.GatewayCustomDomainResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: + """Create or update the Spring Cloud Gateway custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. + :type domain_name: str + :param gateway_custom_domain_resource: The gateway custom domain resource for the create or + update operation. Required. + :type gateway_custom_domain_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + domain_name: str, + gateway_custom_domain_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: + """Create or update the Spring Cloud Gateway custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. + :type domain_name: str + :param gateway_custom_domain_resource: The gateway custom domain resource for the create or + update operation. Required. + :type gateway_custom_domain_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + domain_name: str, + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayCustomDomainResource]: + """Create or update the Spring Cloud Gateway custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. + :type domain_name: str + :param gateway_custom_domain_resource: The gateway custom domain resource for the create or + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. + :type gateway_custom_domain_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + domain_name=domain_name, + gateway_custom_domain_resource=gateway_custom_domain_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete the Spring Cloud Gateway custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. + :type domain_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + domain_name=domain_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> AsyncIterable["_models.GatewayCustomDomainResource"]: + """Handle requests to list all Spring Cloud Gateway custom domains. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :return: An iterator like instance of either GatewayCustomDomainResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.GatewayCustomDomainResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_gateway_route_configs_operations.py new file mode 100644 index 00000000000..bcce043b34f --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_gateway_route_configs_operations.py @@ -0,0 +1,558 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._gateway_route_configs_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class GatewayRouteConfigsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`gateway_route_configs` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any + ) -> _models.GatewayRouteConfigResource: + """Get the Spring Cloud Gateway route configs. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param route_config_name: The name of the Spring Cloud Gateway route config. Required. + :type route_config_name: str + :return: GatewayRouteConfigResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + route_config_name=route_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + route_config_name: str, + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], + **kwargs: Any + ) -> _models.GatewayRouteConfigResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(gateway_route_config_resource, (IOBase, bytes)): + _content = gateway_route_config_resource + else: + _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + route_config_name=route_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + route_config_name: str, + gateway_route_config_resource: _models.GatewayRouteConfigResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: + """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud + Gateway route configs. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param route_config_name: The name of the Spring Cloud Gateway route config. Required. + :type route_config_name: str + :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or + update operation. Required. + :type gateway_route_config_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + route_config_name: str, + gateway_route_config_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: + """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud + Gateway route configs. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param route_config_name: The name of the Spring Cloud Gateway route config. Required. + :type route_config_name: str + :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or + update operation. Required. + :type gateway_route_config_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + route_config_name: str, + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayRouteConfigResource]: + """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud + Gateway route configs. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param route_config_name: The name of the Spring Cloud Gateway route config. Required. + :type route_config_name: str + :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. + :type gateway_route_config_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + route_config_name=route_config_name, + gateway_route_config_resource=gateway_route_config_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + route_config_name=route_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete the Spring Cloud Gateway route config. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param route_config_name: The name of the Spring Cloud Gateway route config. Required. + :type route_config_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + route_config_name=route_config_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> AsyncIterable["_models.GatewayRouteConfigResource"]: + """Handle requests to list all Spring Cloud Gateway route configs. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :return: An iterator like instance of either GatewayRouteConfigResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.GatewayRouteConfigResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_gateways_operations.py new file mode 100644 index 00000000000..ae1d7951e23 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_gateways_operations.py @@ -0,0 +1,1066 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._gateways_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_env_secrets_request, + build_list_request, + build_restart_request, + build_update_capacity_request, + build_validate_domain_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class GatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> _models.GatewayResource: + """Get the Spring Cloud Gateway and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :return: GatewayResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GatewayResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_resource: Union[_models.GatewayResource, IO[bytes]], + **kwargs: Any + ) -> _models.GatewayResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(gateway_resource, (IOBase, bytes)): + _content = gateway_resource + else: + _json = self._serialize.body(gateway_resource, "GatewayResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("GatewayResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("GatewayResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_resource: _models.GatewayResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayResource]: + """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_resource: The gateway for the create or update operation. Required. + :type gateway_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayResource]: + """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_resource: The gateway for the create or update operation. Required. + :type gateway_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_resource: Union[_models.GatewayResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayResource]: + """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_resource: The gateway for the create or update operation. Is either a + GatewayResource type or a IO[bytes] type. Required. + :type gateway_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + gateway_resource=gateway_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("GatewayResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_capacity_initial( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.GatewayResource]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GatewayResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(gateway_capacity_resource, (IOBase, bytes)): + _content = gateway_capacity_resource + else: + _json = self._serialize.body(gateway_capacity_resource, "SkuObject") + + _request = build_update_capacity_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("GatewayResource", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_capacity( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: _models.SkuObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayResource]: + """Operation to update an exiting Spring Cloud Gateway capacity. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_capacity_resource: The gateway capacity for the update operation. Required. + :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SkuObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_capacity( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayResource]: + """Operation to update an exiting Spring Cloud Gateway capacity. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_capacity_resource: The gateway capacity for the update operation. Required. + :type gateway_capacity_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_capacity( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayResource]: + """Operation to update an exiting Spring Cloud Gateway capacity. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a + SkuObject type or a IO[bytes] type. Required. + :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SkuObject + or IO[bytes] + :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_capacity_initial( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + gateway_capacity_resource=gateway_capacity_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("GatewayResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disable the default Spring Cloud Gateway. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def list_env_secrets( + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> Dict[str, str]: + """List sensitive environment variables of Spring Cloud Gateway. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :return: dict mapping str to str or the result of cls(response) + :rtype: dict[str, str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) + + _request = build_list_env_secrets_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("{str}", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _restart_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_restart_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_restart( + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Restart the Spring Cloud Gateway. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._restart_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.GatewayResource"]: + """Handles requests to list all resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either GatewayResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.GatewayResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @overload + async def validate_domain( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + validate_payload: _models.CustomDomainValidatePayload, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the domains are valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param validate_payload: Custom domain payload to be validated. Required. + :type validate_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidatePayload + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate_domain( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + validate_payload: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the domains are valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param validate_payload: Custom domain payload to be validated. Required. + :type validate_payload: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def validate_domain( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the domains are valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param validate_payload: Custom domain payload to be validated. Is either a + CustomDomainValidatePayload type or a IO[bytes] type. Required. + :type validate_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomDomainValidateResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(validate_payload, (IOBase, bytes)): + _content = validate_payload + else: + _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") + + _request = build_validate_domain_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_job_execution_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_job_execution_operations.py new file mode 100644 index 00000000000..d209f76c7d6 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_job_execution_operations.py @@ -0,0 +1,303 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._job_execution_operations import ( + build_cancel_request, + build_get_request, + build_list_env_secrets_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class JobExecutionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`job_execution` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _cancel_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_cancel_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_cancel( + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Terminate execution of a running Azure Spring Apps Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_execution_name: The name of the Job execution. Required. + :type job_execution_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._cancel_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> _models.JobExecution: + """Get details of an execution of an Azure Spring Apps Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_execution_name: The name of the Job execution. Required. + :type job_execution_name: str + :return: JobExecution or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecution + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("JobExecution", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_env_secrets( + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> _models.EnvSecretsCollection: + """List sensitive environment variables of Job execution. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_execution_name: The name of the Job execution. Required. + :type job_execution_name: str + :return: EnvSecretsCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.EnvSecretsCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.EnvSecretsCollection] = kwargs.pop("cls", None) + + _request = build_list_env_secrets_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EnvSecretsCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_job_executions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_job_executions_operations.py new file mode 100644 index 00000000000..2035df838a1 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_job_executions_operations.py @@ -0,0 +1,145 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._job_executions_operations import build_list_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class JobExecutionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`job_executions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> AsyncIterable["_models.JobExecution"]: + """Get executions of a Azure Spring Apps Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :return: An iterator like instance of either JobExecution or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.JobExecutionCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("JobExecutionCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_job_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_job_operations.py new file mode 100644 index 00000000000..5340ebb001c --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_job_operations.py @@ -0,0 +1,729 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._job_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_env_secrets_request, + build_start_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class JobOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`job` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> _models.JobResource: + """Get a Job and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :return: JobResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("JobResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + job_name: str, + job_resource: Union[_models.JobResource, IO[bytes]], + **kwargs: Any + ) -> _models.JobResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(job_resource, (IOBase, bytes)): + _content = job_resource + else: + _json = self._serialize.body(job_resource, "JobResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("JobResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("JobResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Create a new Job or update an exiting Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_resource: Parameters for the create or update operation. Required. + :type job_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + job_name: str, + job_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Create a new Job or update an exiting Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_resource: Parameters for the create or update operation. Required. + :type job_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + job_name: str, + job_resource: Union[_models.JobResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Create a new Job or update an exiting Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_resource: Parameters for the create or update operation. Is either a JobResource + type or a IO[bytes] type. Required. + :type job_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_resource=job_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("JobResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.JobResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.JobResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Operation to delete a Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _start_initial( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[Union[_models.JobExecutionTemplate, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[_models.JobExecution]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.JobExecution]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(template, (IOBase, bytes)): + _content = template + else: + if template is not None: + _json = self._serialize.body(template, "JobExecutionTemplate") + else: + _json = None + + _request = build_start_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("JobExecution", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_start( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[_models.JobExecutionTemplate] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobExecution]: + """Start an Azure Spring Apps Job. + + Start an Azure Spring Apps Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param template: Template used to start a Job execution. Default value is None. + :type template: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecutionTemplate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either JobExecution or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_start( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobExecution]: + """Start an Azure Spring Apps Job. + + Start an Azure Spring Apps Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param template: Template used to start a Job execution. Default value is None. + :type template: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either JobExecution or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_start( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[Union[_models.JobExecutionTemplate, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.JobExecution]: + """Start an Azure Spring Apps Job. + + Start an Azure Spring Apps Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param template: Template used to start a Job execution. Is either a JobExecutionTemplate type + or a IO[bytes] type. Default value is None. + :type template: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecutionTemplate or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either JobExecution or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_initial( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + template=template, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("JobExecution", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.JobExecution].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.JobExecution]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def list_env_secrets( + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> _models.EnvSecretsCollection: + """List sensitive environment variables of the Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :return: EnvSecretsCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.EnvSecretsCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.EnvSecretsCollection] = kwargs.pop("cls", None) + + _request = build_list_env_secrets_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EnvSecretsCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_jobs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_jobs_operations.py new file mode 100644 index 00000000000..a7077f05532 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_jobs_operations.py @@ -0,0 +1,140 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._jobs_operations import build_list_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class JobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`jobs` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.JobResource"]: + """Get the Azure Spring Apps Jobs in a given service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either JobResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.JobResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("JobResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_monitoring_settings_operations.py new file mode 100644 index 00000000000..b11b1640b60 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_monitoring_settings_operations.py @@ -0,0 +1,519 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._monitoring_settings_operations import ( + build_get_request, + build_update_patch_request, + build_update_put_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class MonitoringSettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`monitoring_settings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> _models.MonitoringSettingResource: + """Get the Monitoring Setting and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: MonitoringSettingResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _update_put_initial( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], + **kwargs: Any + ) -> _models.MonitoringSettingResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(monitoring_setting_resource, (IOBase, bytes)): + _content = monitoring_setting_resource + else: + _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") + + _request = build_update_put_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: _models.MonitoringSettingResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MonitoringSettingResource]: + """Update the Monitoring Setting. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param monitoring_setting_resource: Parameters for the update operation. Required. + :type monitoring_setting_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MonitoringSettingResource]: + """Update the Monitoring Setting. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param monitoring_setting_resource: Parameters for the update operation. Required. + :type monitoring_setting_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.MonitoringSettingResource]: + """Update the Monitoring Setting. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param monitoring_setting_resource: Parameters for the update operation. Is either a + MonitoringSettingResource type or a IO[bytes] type. Required. + :type monitoring_setting_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_put_initial( + resource_group_name=resource_group_name, + service_name=service_name, + monitoring_setting_resource=monitoring_setting_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_patch_initial( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], + **kwargs: Any + ) -> _models.MonitoringSettingResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(monitoring_setting_resource, (IOBase, bytes)): + _content = monitoring_setting_resource + else: + _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") + + _request = build_update_patch_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: _models.MonitoringSettingResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MonitoringSettingResource]: + """Update the Monitoring Setting. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param monitoring_setting_resource: Parameters for the update operation. Required. + :type monitoring_setting_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MonitoringSettingResource]: + """Update the Monitoring Setting. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param monitoring_setting_resource: Parameters for the update operation. Required. + :type monitoring_setting_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.MonitoringSettingResource]: + """Update the Monitoring Setting. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param monitoring_setting_resource: Parameters for the update operation. Is either a + MonitoringSettingResource type or a IO[bytes] type. Required. + :type monitoring_setting_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_patch_initial( + resource_group_name=resource_group_name, + service_name=service_name, + monitoring_setting_resource=monitoring_setting_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_operations.py new file mode 100644 index 00000000000..009e077bb23 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_operations.py @@ -0,0 +1,132 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operations import build_list_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: + """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + + :return: An iterator like instance of either OperationDetail or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.OperationDetail] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.AvailableOperations] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AvailableOperations", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_patch.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_predefined_accelerators_operations.py new file mode 100644 index 00000000000..33e3f822eba --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_predefined_accelerators_operations.py @@ -0,0 +1,469 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._predefined_accelerators_operations import ( + build_disable_request, + build_enable_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PredefinedAcceleratorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`predefined_accelerators` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any + ) -> AsyncIterable["_models.PredefinedAcceleratorResource"]: + """Handle requests to list all predefined accelerators. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :return: An iterator like instance of either PredefinedAcceleratorResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.PredefinedAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.PredefinedAcceleratorResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + predefined_accelerator_name: str, + **kwargs: Any + ) -> _models.PredefinedAcceleratorResource: + """Get the predefined accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param predefined_accelerator_name: The name of the predefined accelerator. Required. + :type predefined_accelerator_name: str + :return: PredefinedAcceleratorResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.PredefinedAcceleratorResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + predefined_accelerator_name=predefined_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _disable_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + predefined_accelerator_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_disable_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + predefined_accelerator_name=predefined_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_disable( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + predefined_accelerator_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disable predefined accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param predefined_accelerator_name: The name of the predefined accelerator. Required. + :type predefined_accelerator_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._disable_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + predefined_accelerator_name=predefined_accelerator_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _enable_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + predefined_accelerator_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_enable_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + predefined_accelerator_name=predefined_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_enable( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + predefined_accelerator_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Enable predefined accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param predefined_accelerator_name: The name of the predefined accelerator. Required. + :type predefined_accelerator_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._enable_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + predefined_accelerator_name=predefined_accelerator_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_runtime_versions_operations.py new file mode 100644 index 00000000000..5d9cee12aca --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_runtime_versions_operations.py @@ -0,0 +1,102 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._runtime_versions_operations import build_list_runtime_versions_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class RuntimeVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`runtime_versions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: + """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + + :return: AvailableRuntimeVersions or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AvailableRuntimeVersions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) + + _request = build_list_runtime_versions_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_service_registries_operations.py new file mode 100644 index 00000000000..1f539cf283d --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_service_registries_operations.py @@ -0,0 +1,436 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._service_registries_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ServiceRegistriesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`service_registries` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any + ) -> _models.ServiceRegistryResource: + """Get the Service Registry and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param service_registry_name: The name of Service Registry. Required. + :type service_registry_name: str + :return: ServiceRegistryResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceRegistryResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + service_registry_name=service_registry_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any + ) -> _models.ServiceRegistryResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + service_registry_name=service_registry_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_create_or_update( + self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceRegistryResource]: + """Create the default Service Registry or update the existing 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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param service_registry_name: The name of Service Registry. Required. + :type service_registry_name: str + :return: An instance of AsyncLROPoller that returns either ServiceRegistryResource or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceRegistryResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + service_registry_name=service_registry_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + service_registry_name=service_registry_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, service_registry_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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param service_registry_name: The name of Service Registry. Required. + :type service_registry_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + service_registry_name=service_registry_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ServiceRegistryResource"]: + """Handles requests to list all resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ServiceRegistryResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceRegistryResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ServiceRegistryResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_services_operations.py new file mode 100644 index 00000000000..09ee82738ff --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_services_operations.py @@ -0,0 +1,2122 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._services_operations import ( + build_check_name_availability_request, + build_create_or_update_request, + build_delete_request, + build_disable_apm_globally_request, + build_disable_test_endpoint_request, + build_enable_apm_globally_request, + build_enable_test_endpoint_request, + build_flush_vnet_dns_setting_request, + build_get_request, + build_list_by_subscription_request, + build_list_globally_enabled_apms_request, + build_list_request, + build_list_supported_apm_types_request, + build_list_supported_server_versions_request, + build_list_test_keys_request, + build_regenerate_test_key_request, + build_start_request, + build_stop_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ServicesOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`services` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.ServiceResource: + """Get a Service and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: ServiceResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any + ) -> _models.ServiceResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _json = self._serialize.body(resource, "ServiceResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ServiceResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ServiceResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ServiceResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + resource: _models.ServiceResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceResource]: + """Create a new Service or update an exiting Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param resource: Parameters for the create or update operation. Required. + :type resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceResource]: + """Create a new Service or update an exiting Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param resource: Parameters for the create or update operation. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceResource]: + """Create a new Service or update an exiting Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param resource: Parameters for the create or update operation. Is either a ServiceResource + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + resource=resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ServiceResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Operation to delete a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any + ) -> _models.ServiceResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _json = self._serialize.body(resource, "ServiceResource") + + _request = build_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ServiceResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ServiceResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + service_name: str, + resource: _models.ServiceResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceResource]: + """Operation to update an exiting Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param resource: Parameters for the update operation. Required. + :type resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + service_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceResource]: + """Operation to update an exiting Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param resource: Parameters for the update operation. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServiceResource]: + """Operation to update an exiting Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + resource=resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ServiceResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServiceResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: + """List test keys for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: TestKeys or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.TestKeys + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) + + _request = build_list_test_keys_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TestKeys", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def regenerate_test_key( + self, + resource_group_name: str, + service_name: str, + regenerate_test_key_request: _models.RegenerateTestKeyRequestPayload, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TestKeys: + """Regenerate a test key for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param regenerate_test_key_request: Parameters for the operation. Required. + :type regenerate_test_key_request: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.RegenerateTestKeyRequestPayload + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TestKeys or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.TestKeys + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def regenerate_test_key( + self, + resource_group_name: str, + service_name: str, + regenerate_test_key_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TestKeys: + """Regenerate a test key for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param regenerate_test_key_request: Parameters for the operation. Required. + :type regenerate_test_key_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TestKeys or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.TestKeys + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def regenerate_test_key( + self, + resource_group_name: str, + service_name: str, + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], + **kwargs: Any + ) -> _models.TestKeys: + """Regenerate a test key for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param regenerate_test_key_request: Parameters for the operation. Is either a + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. + :type regenerate_test_key_request: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] + :return: TestKeys or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.TestKeys + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(regenerate_test_key_request, (IOBase, bytes)): + _content = regenerate_test_key_request + else: + _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") + + _request = build_regenerate_test_key_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TestKeys", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + """Disable test endpoint functionality for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_disable_test_endpoint_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def enable_test_endpoint( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> _models.TestKeys: + """Enable test endpoint functionality for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: TestKeys or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.TestKeys + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) + + _request = build_enable_test_endpoint_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TestKeys", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 304: ResourceNotModifiedError, + 404: lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), + 409: lambda response: ResourceExistsError(response=response, error_format=ARMErrorFormat), + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_stop_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Stop a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 304: ResourceNotModifiedError, + 404: lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), + 409: lambda response: ResourceExistsError(response=response, error_format=ARMErrorFormat), + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_start_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Start a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_flush_vnet_dns_setting_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_flush_vnet_dns_setting( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Flush Virtual Network DNS settings for a VNET injected Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._flush_vnet_dns_setting_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_supported_apm_types( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.SupportedApmType"]: + """List supported APM types for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either SupportedApmType or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedApmType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.SupportedApmTypes] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_supported_apm_types_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SupportedApmTypes", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def list_globally_enabled_apms( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> _models.GloballyEnabledApms: + """List globally enabled APMs for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: GloballyEnabledApms or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.GloballyEnabledApms + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None) + + _request = build_list_globally_enabled_apms_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GloballyEnabledApms", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(apm, (IOBase, bytes)): + _content = apm + else: + _json = self._serialize.body(apm, "ApmReference") + + _request = build_enable_apm_globally_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_enable_apm_globally( + self, + resource_group_name: str, + service_name: str, + apm: _models.ApmReference, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Enable an APM globally. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm: The target APM for the enable operation. Required. + :type apm: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmReference + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + async def begin_enable_apm_globally( + self, + resource_group_name: str, + service_name: str, + apm: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Enable an APM globally. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm: The target APM for the enable operation. Required. + :type apm: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace_async + async def begin_enable_apm_globally( + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any + ) -> AsyncLROPoller[None]: + """Enable an APM globally. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm: The target APM for the enable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmReference or IO[bytes] + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._enable_apm_globally_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + apm=apm, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(apm, (IOBase, bytes)): + _content = apm + else: + _json = self._serialize.body(apm, "ApmReference") + + _request = build_disable_apm_globally_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_disable_apm_globally( + self, + resource_group_name: str, + service_name: str, + apm: _models.ApmReference, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disable an APM globally. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm: The target APM for the disable operation. Required. + :type apm: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmReference + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + async def begin_disable_apm_globally( + self, + resource_group_name: str, + service_name: str, + apm: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disable an APM globally. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm: The target APM for the disable operation. Required. + :type apm: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace_async + async def begin_disable_apm_globally( + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disable an APM globally. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm: The target APM for the disable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmReference or IO[bytes] + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._disable_apm_globally_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + apm=apm, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + async def check_name_availability( + self, + location: str, + availability_parameters: _models.NameAvailabilityParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NameAvailability: + """Checks that the resource name is valid and is not already in use. + + :param location: the region. Required. + :type location: str + :param availability_parameters: Parameters supplied to the operation. Required. + :type availability_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.NameAvailabilityParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NameAvailability or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.NameAvailability + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def check_name_availability( + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NameAvailability: + """Checks that the resource name is valid and is not already in use. + + :param location: the region. Required. + :type location: str + :param availability_parameters: Parameters supplied to the operation. Required. + :type availability_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NameAvailability or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.NameAvailability + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def check_name_availability( + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any + ) -> _models.NameAvailability: + """Checks that the resource name is valid and is not already in use. + + :param location: the region. Required. + :type location: str + :param availability_parameters: Parameters supplied to the operation. Is either a + NameAvailabilityParameters type or a IO[bytes] type. Required. + :type availability_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.NameAvailabilityParameters or IO[bytes] + :return: NameAvailability or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.NameAvailability + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NameAvailability] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(availability_parameters, (IOBase, bytes)): + _content = availability_parameters + else: + _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") + + _request = build_check_name_availability_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NameAvailability", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: + """Handles requests to list all resources in a subscription. + + :return: An iterator like instance of either ServiceResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]: + """Handles requests to list all resources in a resource group. + + :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. Required. + :type resource_group_name: str + :return: An iterator like instance of either ServiceResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_supported_server_versions( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.SupportedServerVersion"]: + """Lists all of the available server versions supported by Microsoft.AppPlatform provider. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either SupportedServerVersion or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedServerVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.SupportedServerVersions] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_supported_server_versions_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SupportedServerVersions", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_skus_operations.py new file mode 100644 index 00000000000..3a4fa8b5849 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_skus_operations.py @@ -0,0 +1,133 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._skus_operations import build_list_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class SkusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`skus` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: + """Lists all of the available skus of the Microsoft.AppPlatform provider. + + :return: An iterator like instance of either ResourceSku or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSku] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ResourceSkuCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_storages_operations.py new file mode 100644 index 00000000000..c7c21b1e560 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_storages_operations.py @@ -0,0 +1,532 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._storages_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class StoragesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s + :attr:`storages` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any + ) -> _models.StorageResource: + """Get the storage resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param storage_name: The name of the storage resource. Required. + :type storage_name: str + :return: StorageResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + storage_name=storage_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("StorageResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + storage_name: str, + storage_resource: Union[_models.StorageResource, IO[bytes]], + **kwargs: Any + ) -> _models.StorageResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(storage_resource, (IOBase, bytes)): + _content = storage_resource + else: + _json = self._serialize.body(storage_resource, "StorageResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + storage_name=storage_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("StorageResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("StorageResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("StorageResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + storage_name: str, + storage_resource: _models.StorageResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.StorageResource]: + """Create or update storage resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param storage_name: The name of the storage resource. Required. + :type storage_name: str + :param storage_resource: Parameters for the create or update operation. Required. + :type storage_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either StorageResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + storage_name: str, + storage_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.StorageResource]: + """Create or update storage resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param storage_name: The name of the storage resource. Required. + :type storage_name: str + :param storage_resource: Parameters for the create or update operation. Required. + :type storage_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either StorageResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + storage_name: str, + storage_resource: Union[_models.StorageResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.StorageResource]: + """Create or update storage resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param storage_name: The name of the storage resource. Required. + :type storage_name: str + :param storage_resource: Parameters for the create or update operation. Is either a + StorageResource type or a IO[bytes] type. Required. + :type storage_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either StorageResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + storage_name=storage_name, + storage_resource=storage_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("StorageResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.StorageResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + storage_name=storage_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete the storage resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param storage_name: The name of the storage resource. Required. + :type storage_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + storage_name=storage_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.StorageResource"]: + """List all the storages of one Azure Spring Apps resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either StorageResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.StorageResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("StorageResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/models/__init__.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/models/__init__.py new file mode 100644 index 00000000000..7905ff33e9d --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/models/__init__.py @@ -0,0 +1,689 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._models_py3 import AcceleratorAuthSetting +from ._models_py3 import AcceleratorBasicAuthSetting +from ._models_py3 import AcceleratorGitRepository +from ._models_py3 import AcceleratorPublicSetting +from ._models_py3 import AcceleratorSshSetting +from ._models_py3 import ActiveDeploymentCollection +from ._models_py3 import ApiPortalCustomDomainProperties +from ._models_py3 import ApiPortalCustomDomainResource +from ._models_py3 import ApiPortalCustomDomainResourceCollection +from ._models_py3 import ApiPortalInstance +from ._models_py3 import ApiPortalProperties +from ._models_py3 import ApiPortalResource +from ._models_py3 import ApiPortalResourceCollection +from ._models_py3 import ApiPortalResourceRequests +from ._models_py3 import ApmProperties +from ._models_py3 import ApmReference +from ._models_py3 import ApmResource +from ._models_py3 import ApmResourceCollection +from ._models_py3 import ApmSecretKeys +from ._models_py3 import AppResource +from ._models_py3 import AppResourceCollection +from ._models_py3 import AppResourceProperties +from ._models_py3 import AppVNetAddons +from ._models_py3 import ApplicationAcceleratorComponent +from ._models_py3 import ApplicationAcceleratorInstance +from ._models_py3 import ApplicationAcceleratorProperties +from ._models_py3 import ApplicationAcceleratorResource +from ._models_py3 import ApplicationAcceleratorResourceCollection +from ._models_py3 import ApplicationAcceleratorResourceRequests +from ._models_py3 import ApplicationInsightsAgentVersions +from ._models_py3 import ApplicationLiveViewComponent +from ._models_py3 import ApplicationLiveViewInstance +from ._models_py3 import ApplicationLiveViewProperties +from ._models_py3 import ApplicationLiveViewResource +from ._models_py3 import ApplicationLiveViewResourceCollection +from ._models_py3 import ApplicationLiveViewResourceRequests +from ._models_py3 import AvailableOperations +from ._models_py3 import AvailableRuntimeVersions +from ._models_py3 import AzureFileVolume +from ._models_py3 import BindingResource +from ._models_py3 import BindingResourceCollection +from ._models_py3 import BindingResourceProperties +from ._models_py3 import Build +from ._models_py3 import BuildCollection +from ._models_py3 import BuildProperties +from ._models_py3 import BuildResourceRequests +from ._models_py3 import BuildResult +from ._models_py3 import BuildResultCollection +from ._models_py3 import BuildResultLog +from ._models_py3 import BuildResultProperties +from ._models_py3 import BuildResultUserSourceInfo +from ._models_py3 import BuildService +from ._models_py3 import BuildServiceAgentPoolProperties +from ._models_py3 import BuildServiceAgentPoolResource +from ._models_py3 import BuildServiceAgentPoolResourceCollection +from ._models_py3 import BuildServiceAgentPoolSizeProperties +from ._models_py3 import BuildServiceCollection +from ._models_py3 import BuildServiceProperties +from ._models_py3 import BuildServicePropertiesResourceRequests +from ._models_py3 import BuildStageProperties +from ._models_py3 import BuilderProperties +from ._models_py3 import BuilderResource +from ._models_py3 import BuilderResourceCollection +from ._models_py3 import BuildpackBindingLaunchProperties +from ._models_py3 import BuildpackBindingProperties +from ._models_py3 import BuildpackBindingResource +from ._models_py3 import BuildpackBindingResourceCollection +from ._models_py3 import BuildpackProperties +from ._models_py3 import BuildpacksGroupProperties +from ._models_py3 import CertificateProperties +from ._models_py3 import CertificateReference +from ._models_py3 import CertificateResource +from ._models_py3 import CertificateResourceCollection +from ._models_py3 import CloudErrorBody +from ._models_py3 import ClusterResourceProperties +from ._models_py3 import ConfigServerGitProperty +from ._models_py3 import ConfigServerInstance +from ._models_py3 import ConfigServerProperties +from ._models_py3 import ConfigServerResource +from ._models_py3 import ConfigServerResourceCollection +from ._models_py3 import ConfigServerResourceRequests +from ._models_py3 import ConfigServerSettings +from ._models_py3 import ConfigServerSettingsErrorRecord +from ._models_py3 import ConfigServerSettingsValidateResult +from ._models_py3 import ConfigurationServiceGitProperty +from ._models_py3 import ConfigurationServiceGitPropertyValidateResult +from ._models_py3 import ConfigurationServiceGitRepository +from ._models_py3 import ConfigurationServiceInstance +from ._models_py3 import ConfigurationServiceProperties +from ._models_py3 import ConfigurationServiceResource +from ._models_py3 import ConfigurationServiceResourceCollection +from ._models_py3 import ConfigurationServiceResourceRequests +from ._models_py3 import ConfigurationServiceSettings +from ._models_py3 import ConfigurationServiceSettingsValidateResult +from ._models_py3 import ContainerProbeSettings +from ._models_py3 import ContainerRegistryBasicCredentials +from ._models_py3 import ContainerRegistryCredentials +from ._models_py3 import ContainerRegistryProperties +from ._models_py3 import ContainerRegistryResource +from ._models_py3 import ContainerRegistryResourceCollection +from ._models_py3 import ContainerRegistryValidateResult +from ._models_py3 import ContentCertificateProperties +from ._models_py3 import CustomContainer +from ._models_py3 import CustomContainerUserSourceInfo +from ._models_py3 import CustomDomainProperties +from ._models_py3 import CustomDomainResource +from ._models_py3 import CustomDomainResourceCollection +from ._models_py3 import CustomDomainValidatePayload +from ._models_py3 import CustomDomainValidateResult +from ._models_py3 import CustomPersistentDiskProperties +from ._models_py3 import CustomPersistentDiskResource +from ._models_py3 import CustomScaleRule +from ._models_py3 import CustomizedAcceleratorProperties +from ._models_py3 import CustomizedAcceleratorResource +from ._models_py3 import CustomizedAcceleratorResourceCollection +from ._models_py3 import CustomizedAcceleratorValidateResult +from ._models_py3 import DeploymentInstance +from ._models_py3 import DeploymentList +from ._models_py3 import DeploymentResource +from ._models_py3 import DeploymentResourceCollection +from ._models_py3 import DeploymentResourceProperties +from ._models_py3 import DeploymentSettings +from ._models_py3 import DevToolPortalComponent +from ._models_py3 import DevToolPortalFeatureDetail +from ._models_py3 import DevToolPortalFeatureSettings +from ._models_py3 import DevToolPortalInstance +from ._models_py3 import DevToolPortalProperties +from ._models_py3 import DevToolPortalResource +from ._models_py3 import DevToolPortalResourceCollection +from ._models_py3 import DevToolPortalResourceRequests +from ._models_py3 import DevToolPortalSsoProperties +from ._models_py3 import DiagnosticParameters +from ._models_py3 import EnvSecretsCollection +from ._models_py3 import EnvVar +from ._models_py3 import Error +from ._models_py3 import EurekaServerProperties +from ._models_py3 import EurekaServerResource +from ._models_py3 import EurekaServerResourceCollection +from ._models_py3 import ExecAction +from ._models_py3 import GatewayApiMetadataProperties +from ._models_py3 import GatewayApiRoute +from ._models_py3 import GatewayCorsProperties +from ._models_py3 import GatewayCustomDomainProperties +from ._models_py3 import GatewayCustomDomainResource +from ._models_py3 import GatewayCustomDomainResourceCollection +from ._models_py3 import GatewayInstance +from ._models_py3 import GatewayLocalResponseCachePerInstanceProperties +from ._models_py3 import GatewayLocalResponseCachePerRouteProperties +from ._models_py3 import GatewayOperatorProperties +from ._models_py3 import GatewayOperatorResourceRequests +from ._models_py3 import GatewayProperties +from ._models_py3 import GatewayPropertiesClientAuth +from ._models_py3 import GatewayPropertiesEnvironmentVariables +from ._models_py3 import GatewayResource +from ._models_py3 import GatewayResourceCollection +from ._models_py3 import GatewayResourceRequests +from ._models_py3 import GatewayResponseCacheProperties +from ._models_py3 import GatewayRouteConfigOpenApiProperties +from ._models_py3 import GatewayRouteConfigProperties +from ._models_py3 import GatewayRouteConfigResource +from ._models_py3 import GatewayRouteConfigResourceCollection +from ._models_py3 import GitPatternRepository +from ._models_py3 import GloballyEnabledApms +from ._models_py3 import HTTPGetAction +from ._models_py3 import HttpScaleRule +from ._models_py3 import ImageRegistryCredential +from ._models_py3 import IngressConfig +from ._models_py3 import IngressSettings +from ._models_py3 import IngressSettingsClientAuth +from ._models_py3 import JarUploadedUserSourceInfo +from ._models_py3 import JobExecution +from ._models_py3 import JobExecutionCollection +from ._models_py3 import JobExecutionTemplate +from ._models_py3 import JobResource +from ._models_py3 import JobResourceCollection +from ._models_py3 import JobResourceProperties +from ._models_py3 import JobResourceRequests +from ._models_py3 import JobTriggerConfig +from ._models_py3 import KeyVaultCertificateProperties +from ._models_py3 import LoadedCertificate +from ._models_py3 import LogFileUrlResponse +from ._models_py3 import LogSpecification +from ._models_py3 import MaintenanceScheduleConfiguration +from ._models_py3 import ManagedComponentReference +from ._models_py3 import ManagedIdentityProperties +from ._models_py3 import ManualJobTriggerConfig +from ._models_py3 import MarketplaceResource +from ._models_py3 import MetricDimension +from ._models_py3 import MetricSpecification +from ._models_py3 import MonitoringSettingProperties +from ._models_py3 import MonitoringSettingResource +from ._models_py3 import NameAvailability +from ._models_py3 import NameAvailabilityParameters +from ._models_py3 import NetCoreZipUploadedUserSourceInfo +from ._models_py3 import NetworkProfile +from ._models_py3 import NetworkProfileOutboundIPs +from ._models_py3 import OperationDetail +from ._models_py3 import OperationDisplay +from ._models_py3 import OperationProperties +from ._models_py3 import PersistentDisk +from ._models_py3 import PredefinedAcceleratorProperties +from ._models_py3 import PredefinedAcceleratorResource +from ._models_py3 import PredefinedAcceleratorResourceCollection +from ._models_py3 import Probe +from ._models_py3 import ProbeAction +from ._models_py3 import ProxyResource +from ._models_py3 import QueueScaleRule +from ._models_py3 import RegenerateTestKeyRequestPayload +from ._models_py3 import RemoteDebugging +from ._models_py3 import RemoteDebuggingPayload +from ._models_py3 import RequiredTraffic +from ._models_py3 import Resource +from ._models_py3 import ResourceRequests +from ._models_py3 import ResourceSku +from ._models_py3 import ResourceSkuCapabilities +from ._models_py3 import ResourceSkuCollection +from ._models_py3 import ResourceSkuLocationInfo +from ._models_py3 import ResourceSkuRestrictionInfo +from ._models_py3 import ResourceSkuRestrictions +from ._models_py3 import ResourceSkuZoneDetails +from ._models_py3 import ResourceUploadDefinition +from ._models_py3 import Scale +from ._models_py3 import ScaleRule +from ._models_py3 import ScaleRuleAuth +from ._models_py3 import Secret +from ._models_py3 import ServiceRegistryInstance +from ._models_py3 import ServiceRegistryProperties +from ._models_py3 import ServiceRegistryResource +from ._models_py3 import ServiceRegistryResourceCollection +from ._models_py3 import ServiceRegistryResourceRequests +from ._models_py3 import ServiceResource +from ._models_py3 import ServiceResourceList +from ._models_py3 import ServiceSpecification +from ._models_py3 import ServiceVNetAddons +from ._models_py3 import Sku +from ._models_py3 import SkuCapacity +from ._models_py3 import SkuObject +from ._models_py3 import SourceUploadedUserSourceInfo +from ._models_py3 import SsoProperties +from ._models_py3 import StackProperties +from ._models_py3 import StorageAccount +from ._models_py3 import StorageProperties +from ._models_py3 import StorageResource +from ._models_py3 import StorageResourceCollection +from ._models_py3 import SupportedApmType +from ._models_py3 import SupportedApmTypes +from ._models_py3 import SupportedBuildpackResource +from ._models_py3 import SupportedBuildpackResourceProperties +from ._models_py3 import SupportedBuildpacksCollection +from ._models_py3 import SupportedRuntimeVersion +from ._models_py3 import SupportedServerVersion +from ._models_py3 import SupportedServerVersions +from ._models_py3 import SupportedStackResource +from ._models_py3 import SupportedStackResourceProperties +from ._models_py3 import SupportedStacksCollection +from ._models_py3 import SystemAssignedServiceIdentity +from ._models_py3 import SystemData +from ._models_py3 import TCPSocketAction +from ._models_py3 import TcpScaleRule +from ._models_py3 import TemporaryDisk +from ._models_py3 import TestKeys +from ._models_py3 import TrackedResource +from ._models_py3 import TriggeredBuildResult +from ._models_py3 import UploadedUserSourceInfo +from ._models_py3 import UserAssignedManagedIdentity +from ._models_py3 import UserSourceInfo +from ._models_py3 import ValidationMessages +from ._models_py3 import WarUploadedUserSourceInfo +from ._models_py3 import WeeklyMaintenanceScheduleConfiguration + +from ._app_platform_management_client_enums import ActionType +from ._app_platform_management_client_enums import ApiPortalApiTryOutEnabledState +from ._app_platform_management_client_enums import ApiPortalProvisioningState +from ._app_platform_management_client_enums import ApmProvisioningState +from ._app_platform_management_client_enums import ApmType +from ._app_platform_management_client_enums import AppResourceProvisioningState +from ._app_platform_management_client_enums import ApplicationAcceleratorProvisioningState +from ._app_platform_management_client_enums import ApplicationLiveViewProvisioningState +from ._app_platform_management_client_enums import BackendProtocol +from ._app_platform_management_client_enums import BindingType +from ._app_platform_management_client_enums import BuildProvisioningState +from ._app_platform_management_client_enums import BuildResultProvisioningState +from ._app_platform_management_client_enums import BuildServiceProvisioningState +from ._app_platform_management_client_enums import BuilderProvisioningState +from ._app_platform_management_client_enums import BuildpackBindingProvisioningState +from ._app_platform_management_client_enums import CertificateResourceProvisioningState +from ._app_platform_management_client_enums import ConfigServerEnabledState +from ._app_platform_management_client_enums import ConfigServerState +from ._app_platform_management_client_enums import ConfigurationServiceGeneration +from ._app_platform_management_client_enums import ConfigurationServiceProvisioningState +from ._app_platform_management_client_enums import ContainerRegistryProvisioningState +from ._app_platform_management_client_enums import CreatedByType +from ._app_platform_management_client_enums import CustomDomainResourceProvisioningState +from ._app_platform_management_client_enums import CustomizedAcceleratorProvisioningState +from ._app_platform_management_client_enums import CustomizedAcceleratorType +from ._app_platform_management_client_enums import CustomizedAcceleratorValidateResultState +from ._app_platform_management_client_enums import DeploymentResourceProvisioningState +from ._app_platform_management_client_enums import DeploymentResourceStatus +from ._app_platform_management_client_enums import DevToolPortalFeatureState +from ._app_platform_management_client_enums import DevToolPortalProvisioningState +from ._app_platform_management_client_enums import EurekaServerEnabledState +from ._app_platform_management_client_enums import EurekaServerState +from ._app_platform_management_client_enums import Frequency +from ._app_platform_management_client_enums import GatewayCertificateVerification +from ._app_platform_management_client_enums import GatewayProvisioningState +from ._app_platform_management_client_enums import GatewayRouteConfigProtocol +from ._app_platform_management_client_enums import GitImplementation +from ._app_platform_management_client_enums import HTTPSchemeType +from ._app_platform_management_client_enums import JobExecutionRunningState +from ._app_platform_management_client_enums import JobResourceProvisioningState +from ._app_platform_management_client_enums import KPackBuildStageProvisioningState +from ._app_platform_management_client_enums import KeyVaultCertificateAutoSync +from ._app_platform_management_client_enums import LastModifiedByType +from ._app_platform_management_client_enums import ManagedIdentityType +from ._app_platform_management_client_enums import MonitoringSettingState +from ._app_platform_management_client_enums import PowerState +from ._app_platform_management_client_enums import PredefinedAcceleratorProvisioningState +from ._app_platform_management_client_enums import PredefinedAcceleratorState +from ._app_platform_management_client_enums import PrivateStorageAccess +from ._app_platform_management_client_enums import ProbeActionType +from ._app_platform_management_client_enums import ProvisioningState +from ._app_platform_management_client_enums import ResourceSkuRestrictionsReasonCode +from ._app_platform_management_client_enums import ResourceSkuRestrictionsType +from ._app_platform_management_client_enums import ServiceRegistryProvisioningState +from ._app_platform_management_client_enums import SessionAffinity +from ._app_platform_management_client_enums import SkuScaleType +from ._app_platform_management_client_enums import StorageType +from ._app_platform_management_client_enums import SupportedRuntimePlatform +from ._app_platform_management_client_enums import SupportedRuntimeValue +from ._app_platform_management_client_enums import SystemAssignedServiceIdentityType +from ._app_platform_management_client_enums import TestEndpointAuthState +from ._app_platform_management_client_enums import TestKeyType +from ._app_platform_management_client_enums import TrafficDirection +from ._app_platform_management_client_enums import TriggerType +from ._app_platform_management_client_enums import TriggeredBuildResultProvisioningState +from ._app_platform_management_client_enums import Type +from ._app_platform_management_client_enums import WeekDay +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AcceleratorAuthSetting", + "AcceleratorBasicAuthSetting", + "AcceleratorGitRepository", + "AcceleratorPublicSetting", + "AcceleratorSshSetting", + "ActiveDeploymentCollection", + "ApiPortalCustomDomainProperties", + "ApiPortalCustomDomainResource", + "ApiPortalCustomDomainResourceCollection", + "ApiPortalInstance", + "ApiPortalProperties", + "ApiPortalResource", + "ApiPortalResourceCollection", + "ApiPortalResourceRequests", + "ApmProperties", + "ApmReference", + "ApmResource", + "ApmResourceCollection", + "ApmSecretKeys", + "AppResource", + "AppResourceCollection", + "AppResourceProperties", + "AppVNetAddons", + "ApplicationAcceleratorComponent", + "ApplicationAcceleratorInstance", + "ApplicationAcceleratorProperties", + "ApplicationAcceleratorResource", + "ApplicationAcceleratorResourceCollection", + "ApplicationAcceleratorResourceRequests", + "ApplicationInsightsAgentVersions", + "ApplicationLiveViewComponent", + "ApplicationLiveViewInstance", + "ApplicationLiveViewProperties", + "ApplicationLiveViewResource", + "ApplicationLiveViewResourceCollection", + "ApplicationLiveViewResourceRequests", + "AvailableOperations", + "AvailableRuntimeVersions", + "AzureFileVolume", + "BindingResource", + "BindingResourceCollection", + "BindingResourceProperties", + "Build", + "BuildCollection", + "BuildProperties", + "BuildResourceRequests", + "BuildResult", + "BuildResultCollection", + "BuildResultLog", + "BuildResultProperties", + "BuildResultUserSourceInfo", + "BuildService", + "BuildServiceAgentPoolProperties", + "BuildServiceAgentPoolResource", + "BuildServiceAgentPoolResourceCollection", + "BuildServiceAgentPoolSizeProperties", + "BuildServiceCollection", + "BuildServiceProperties", + "BuildServicePropertiesResourceRequests", + "BuildStageProperties", + "BuilderProperties", + "BuilderResource", + "BuilderResourceCollection", + "BuildpackBindingLaunchProperties", + "BuildpackBindingProperties", + "BuildpackBindingResource", + "BuildpackBindingResourceCollection", + "BuildpackProperties", + "BuildpacksGroupProperties", + "CertificateProperties", + "CertificateReference", + "CertificateResource", + "CertificateResourceCollection", + "CloudErrorBody", + "ClusterResourceProperties", + "ConfigServerGitProperty", + "ConfigServerInstance", + "ConfigServerProperties", + "ConfigServerResource", + "ConfigServerResourceCollection", + "ConfigServerResourceRequests", + "ConfigServerSettings", + "ConfigServerSettingsErrorRecord", + "ConfigServerSettingsValidateResult", + "ConfigurationServiceGitProperty", + "ConfigurationServiceGitPropertyValidateResult", + "ConfigurationServiceGitRepository", + "ConfigurationServiceInstance", + "ConfigurationServiceProperties", + "ConfigurationServiceResource", + "ConfigurationServiceResourceCollection", + "ConfigurationServiceResourceRequests", + "ConfigurationServiceSettings", + "ConfigurationServiceSettingsValidateResult", + "ContainerProbeSettings", + "ContainerRegistryBasicCredentials", + "ContainerRegistryCredentials", + "ContainerRegistryProperties", + "ContainerRegistryResource", + "ContainerRegistryResourceCollection", + "ContainerRegistryValidateResult", + "ContentCertificateProperties", + "CustomContainer", + "CustomContainerUserSourceInfo", + "CustomDomainProperties", + "CustomDomainResource", + "CustomDomainResourceCollection", + "CustomDomainValidatePayload", + "CustomDomainValidateResult", + "CustomPersistentDiskProperties", + "CustomPersistentDiskResource", + "CustomScaleRule", + "CustomizedAcceleratorProperties", + "CustomizedAcceleratorResource", + "CustomizedAcceleratorResourceCollection", + "CustomizedAcceleratorValidateResult", + "DeploymentInstance", + "DeploymentList", + "DeploymentResource", + "DeploymentResourceCollection", + "DeploymentResourceProperties", + "DeploymentSettings", + "DevToolPortalComponent", + "DevToolPortalFeatureDetail", + "DevToolPortalFeatureSettings", + "DevToolPortalInstance", + "DevToolPortalProperties", + "DevToolPortalResource", + "DevToolPortalResourceCollection", + "DevToolPortalResourceRequests", + "DevToolPortalSsoProperties", + "DiagnosticParameters", + "EnvSecretsCollection", + "EnvVar", + "Error", + "EurekaServerProperties", + "EurekaServerResource", + "EurekaServerResourceCollection", + "ExecAction", + "GatewayApiMetadataProperties", + "GatewayApiRoute", + "GatewayCorsProperties", + "GatewayCustomDomainProperties", + "GatewayCustomDomainResource", + "GatewayCustomDomainResourceCollection", + "GatewayInstance", + "GatewayLocalResponseCachePerInstanceProperties", + "GatewayLocalResponseCachePerRouteProperties", + "GatewayOperatorProperties", + "GatewayOperatorResourceRequests", + "GatewayProperties", + "GatewayPropertiesClientAuth", + "GatewayPropertiesEnvironmentVariables", + "GatewayResource", + "GatewayResourceCollection", + "GatewayResourceRequests", + "GatewayResponseCacheProperties", + "GatewayRouteConfigOpenApiProperties", + "GatewayRouteConfigProperties", + "GatewayRouteConfigResource", + "GatewayRouteConfigResourceCollection", + "GitPatternRepository", + "GloballyEnabledApms", + "HTTPGetAction", + "HttpScaleRule", + "ImageRegistryCredential", + "IngressConfig", + "IngressSettings", + "IngressSettingsClientAuth", + "JarUploadedUserSourceInfo", + "JobExecution", + "JobExecutionCollection", + "JobExecutionTemplate", + "JobResource", + "JobResourceCollection", + "JobResourceProperties", + "JobResourceRequests", + "JobTriggerConfig", + "KeyVaultCertificateProperties", + "LoadedCertificate", + "LogFileUrlResponse", + "LogSpecification", + "MaintenanceScheduleConfiguration", + "ManagedComponentReference", + "ManagedIdentityProperties", + "ManualJobTriggerConfig", + "MarketplaceResource", + "MetricDimension", + "MetricSpecification", + "MonitoringSettingProperties", + "MonitoringSettingResource", + "NameAvailability", + "NameAvailabilityParameters", + "NetCoreZipUploadedUserSourceInfo", + "NetworkProfile", + "NetworkProfileOutboundIPs", + "OperationDetail", + "OperationDisplay", + "OperationProperties", + "PersistentDisk", + "PredefinedAcceleratorProperties", + "PredefinedAcceleratorResource", + "PredefinedAcceleratorResourceCollection", + "Probe", + "ProbeAction", + "ProxyResource", + "QueueScaleRule", + "RegenerateTestKeyRequestPayload", + "RemoteDebugging", + "RemoteDebuggingPayload", + "RequiredTraffic", + "Resource", + "ResourceRequests", + "ResourceSku", + "ResourceSkuCapabilities", + "ResourceSkuCollection", + "ResourceSkuLocationInfo", + "ResourceSkuRestrictionInfo", + "ResourceSkuRestrictions", + "ResourceSkuZoneDetails", + "ResourceUploadDefinition", + "Scale", + "ScaleRule", + "ScaleRuleAuth", + "Secret", + "ServiceRegistryInstance", + "ServiceRegistryProperties", + "ServiceRegistryResource", + "ServiceRegistryResourceCollection", + "ServiceRegistryResourceRequests", + "ServiceResource", + "ServiceResourceList", + "ServiceSpecification", + "ServiceVNetAddons", + "Sku", + "SkuCapacity", + "SkuObject", + "SourceUploadedUserSourceInfo", + "SsoProperties", + "StackProperties", + "StorageAccount", + "StorageProperties", + "StorageResource", + "StorageResourceCollection", + "SupportedApmType", + "SupportedApmTypes", + "SupportedBuildpackResource", + "SupportedBuildpackResourceProperties", + "SupportedBuildpacksCollection", + "SupportedRuntimeVersion", + "SupportedServerVersion", + "SupportedServerVersions", + "SupportedStackResource", + "SupportedStackResourceProperties", + "SupportedStacksCollection", + "SystemAssignedServiceIdentity", + "SystemData", + "TCPSocketAction", + "TcpScaleRule", + "TemporaryDisk", + "TestKeys", + "TrackedResource", + "TriggeredBuildResult", + "UploadedUserSourceInfo", + "UserAssignedManagedIdentity", + "UserSourceInfo", + "ValidationMessages", + "WarUploadedUserSourceInfo", + "WeeklyMaintenanceScheduleConfiguration", + "ActionType", + "ApiPortalApiTryOutEnabledState", + "ApiPortalProvisioningState", + "ApmProvisioningState", + "ApmType", + "AppResourceProvisioningState", + "ApplicationAcceleratorProvisioningState", + "ApplicationLiveViewProvisioningState", + "BackendProtocol", + "BindingType", + "BuildProvisioningState", + "BuildResultProvisioningState", + "BuildServiceProvisioningState", + "BuilderProvisioningState", + "BuildpackBindingProvisioningState", + "CertificateResourceProvisioningState", + "ConfigServerEnabledState", + "ConfigServerState", + "ConfigurationServiceGeneration", + "ConfigurationServiceProvisioningState", + "ContainerRegistryProvisioningState", + "CreatedByType", + "CustomDomainResourceProvisioningState", + "CustomizedAcceleratorProvisioningState", + "CustomizedAcceleratorType", + "CustomizedAcceleratorValidateResultState", + "DeploymentResourceProvisioningState", + "DeploymentResourceStatus", + "DevToolPortalFeatureState", + "DevToolPortalProvisioningState", + "EurekaServerEnabledState", + "EurekaServerState", + "Frequency", + "GatewayCertificateVerification", + "GatewayProvisioningState", + "GatewayRouteConfigProtocol", + "GitImplementation", + "HTTPSchemeType", + "JobExecutionRunningState", + "JobResourceProvisioningState", + "KPackBuildStageProvisioningState", + "KeyVaultCertificateAutoSync", + "LastModifiedByType", + "ManagedIdentityType", + "MonitoringSettingState", + "PowerState", + "PredefinedAcceleratorProvisioningState", + "PredefinedAcceleratorState", + "PrivateStorageAccess", + "ProbeActionType", + "ProvisioningState", + "ResourceSkuRestrictionsReasonCode", + "ResourceSkuRestrictionsType", + "ServiceRegistryProvisioningState", + "SessionAffinity", + "SkuScaleType", + "StorageType", + "SupportedRuntimePlatform", + "SupportedRuntimeValue", + "SystemAssignedServiceIdentityType", + "TestEndpointAuthState", + "TestKeyType", + "TrafficDirection", + "TriggerType", + "TriggeredBuildResultProvisioningState", + "Type", + "WeekDay", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/models/_app_platform_management_client_enums.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/models/_app_platform_management_client_enums.py new file mode 100644 index 00000000000..0798f5d85f1 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/models/_app_platform_management_client_enums.py @@ -0,0 +1,622 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" + + INTERNAL = "Internal" + + +class ApiPortalApiTryOutEnabledState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates whether the API try-out feature is enabled or disabled. When enabled, users can try + out the API by sending requests and viewing responses in API portal. When disabled, users + cannot try out the API. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + + +class ApiPortalProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the API portal.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + + +class ApmProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the APM.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + CANCELED = "Canceled" + + +class ApmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of application performance monitoring.""" + + APPLICATION_INSIGHTS = "ApplicationInsights" + APP_DYNAMICS = "AppDynamics" + DYNATRACE = "Dynatrace" + NEW_RELIC = "NewRelic" + ELASTIC_APM = "ElasticAPM" + + +class ApplicationAcceleratorProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the application accelerator.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + CANCELED = "Canceled" + + +class ApplicationLiveViewProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the Application Live View.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + CANCELED = "Canceled" + + +class AppResourceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the App.""" + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + + +class BackendProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """How ingress should communicate with this app backend service.""" + + GRPC = "GRPC" + DEFAULT = "Default" + + +class BindingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Buildpack Binding Type.""" + + APPLICATION_INSIGHTS = "ApplicationInsights" + APACHE_SKY_WALKING = "ApacheSkyWalking" + APP_DYNAMICS = "AppDynamics" + DYNATRACE = "Dynatrace" + NEW_RELIC = "NewRelic" + ELASTIC_APM = "ElasticAPM" + CA_CERTIFICATES = "CACertificates" + + +class BuilderProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Builder provision status.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + + +class BuildpackBindingProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the Buildpack Binding.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + + +class BuildProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the KPack build result.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + + +class BuildResultProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the KPack build result.""" + + QUEUING = "Queuing" + BUILDING = "Building" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + + +class BuildServiceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the KPack build service.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + + +class CertificateResourceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the Certificate.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + + +class ConfigServerEnabledState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enabled state of the config server. This is only used in Consumption tier.""" + + ENABLED = "Enabled" + """Enable the config server.""" + DISABLED = "Disabled" + """Disable the config server.""" + + +class ConfigServerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the config server.""" + + NOT_AVAILABLE = "NotAvailable" + CREATING = "Creating" + DELETED = "Deleted" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + DELETING = "Deleting" + + +class ConfigurationServiceGeneration(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The generation of the Application Configuration Service.""" + + GEN1 = "Gen1" + GEN2 = "Gen2" + + +class ConfigurationServiceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the Application Configuration Service.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + + +class ContainerRegistryProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the Container Registry.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + CANCELED = "Canceled" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity that created the resource.""" + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + + +class CustomDomainResourceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the Domain.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + + +class CustomizedAcceleratorProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the customized accelerator.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + CANCELED = "Canceled" + + +class CustomizedAcceleratorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the customized accelerator.""" + + ACCELERATOR = "Accelerator" + FRAGMENT = "Fragment" + + +class CustomizedAcceleratorValidateResultState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the customized accelerator validation result.""" + + VALID = "Valid" + """Customized accelerator properties are valid.""" + INVALID = "Invalid" + """Customized accelerator properties are invalid.""" + + +class DeploymentResourceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the Deployment.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + + +class DeploymentResourceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the Deployment.""" + + STOPPED = "Stopped" + RUNNING = "Running" + + +class DevToolPortalFeatureState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the plugin.""" + + ENABLED = "Enabled" + """Enable the plugin in Dev Tool Portal.""" + DISABLED = "Disabled" + """Disable the plugin in Dev Tool Portal.""" + + +class DevToolPortalProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the Dev Tool Portal.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + CANCELED = "Canceled" + + +class EurekaServerEnabledState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enabled state of the eureka server. This is only used in Consumption tier.""" + + ENABLED = "Enabled" + """Enable the eureka server.""" + DISABLED = "Disabled" + """Disable the eureka server.""" + + +class EurekaServerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the eureka server.""" + + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + CANCELED = "Canceled" + + +class Frequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The frequency to run the maintenance job.""" + + WEEKLY = "Weekly" + + +class GatewayCertificateVerification(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether to enable certificate verification or not.""" + + ENABLED = "Enabled" + """Enable certificate verification in Spring Cloud Gateway.""" + DISABLED = "Disabled" + """Disable certificate verification in Spring Cloud Gateway.""" + + +class GatewayProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the Spring Cloud Gateway.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + + +class GatewayRouteConfigProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Protocol of routed Azure Spring Apps applications.""" + + HTTP = "HTTP" + HTTPS = "HTTPS" + + +class GitImplementation(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Git libraries used to support various repository providers.""" + + GO_GIT = "go-git" + LIBGIT2 = "libgit2" + + +class HTTPSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Scheme to use for connecting to the host. Defaults to HTTP. + + Possible enum values: + + + * ``"HTTP"`` means that the scheme used will be http:// + * ``"HTTPS"`` means that the scheme used will be https://. + """ + + HTTP = "HTTP" + HTTPS = "HTTPS" + + +class JobExecutionRunningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Current state of the job execution.""" + + RUNNING = "Running" + PENDING = "Pending" + CANCELED = "Canceled" + FAILED = "Failed" + COMPLETED = "Completed" + + +class JobResourceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the Job.""" + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + CANCELED = "Canceled" + + +class KeyVaultCertificateAutoSync(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates whether to automatically synchronize certificate from key vault or not.""" + + DISABLED = "Disabled" + ENABLED = "Enabled" + + +class KPackBuildStageProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of this build stage resource.""" + + NOT_STARTED = "NotStarted" + RUNNING = "Running" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + + +class LastModifiedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity that last modified the resource.""" + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + + +class ManagedIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the managed identity.""" + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + + +class MonitoringSettingState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the Monitoring Setting.""" + + NOT_AVAILABLE = "NotAvailable" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + +class PowerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Power state of the Service.""" + + RUNNING = "Running" + STOPPED = "Stopped" + + +class PredefinedAcceleratorProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the predefined accelerator.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + + +class PredefinedAcceleratorState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the predefined accelerator.""" + + ENABLED = "Enabled" + """Enable the predefined accelerator.""" + DISABLED = "Disabled" + """Disable the predefined accelerator.""" + + +class PrivateStorageAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates whether the vnet injection service enables private links for backend storage account + and container registry. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + + +class ProbeActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of the action to take to perform the health check.""" + + HTTP_GET_ACTION = "HTTPGetAction" + TCP_SOCKET_ACTION = "TCPSocketAction" + EXEC_ACTION = "ExecAction" + + +class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the Service.""" + + CREATING = "Creating" + UPDATING = "Updating" + STARTING = "Starting" + STOPPING = "Stopping" + DELETING = "Deleting" + DELETED = "Deleted" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + MOVING = "Moving" + MOVED = "Moved" + MOVE_FAILED = "MoveFailed" + + +class ResourceSkuRestrictionsReasonCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Gets the reason for restriction. Possible values include: 'QuotaId', + 'NotAvailableForSubscription'. + """ + + QUOTA_ID = "QuotaId" + NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" + + +class ResourceSkuRestrictionsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Gets the type of restrictions. Possible values include: 'Location', 'Zone'.""" + + LOCATION = "Location" + ZONE = "Zone" + + +class ServiceRegistryProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the Service Registry.""" + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + + +class SessionAffinity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the affinity, set this to Cookie to enable session affinity.""" + + COOKIE = "Cookie" + NONE = "None" + + +class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Gets or sets the type of the scale.""" + + NONE = "None" + MANUAL = "Manual" + AUTOMATIC = "Automatic" + + +class StorageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of the storage.""" + + STORAGE_ACCOUNT = "StorageAccount" + + +class SupportedRuntimePlatform(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The platform of this runtime version (possible values: "Java" or ".NET").""" + + JAVA = "Java" + _NET_CORE = ".NET Core" + + +class SupportedRuntimeValue(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The raw value which could be passed to deployment CRUD operations.""" + + JAVA8 = "Java_8" + JAVA11 = "Java_11" + JAVA17 = "Java_17" + JAVA21 = "Java_21" + NET_CORE31 = "NetCore_31" + + +class SystemAssignedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of managed service identity (either system assigned, or none).""" + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + + +class TestEndpointAuthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of test endpoint auth.""" + + ENABLED = "Enabled" + """Enable test endpoint auth.""" + DISABLED = "Disabled" + """Disable test endpoint auth""" + + +class TestKeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the test key.""" + + PRIMARY = "Primary" + SECONDARY = "Secondary" + + +class TrafficDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The direction of required traffic.""" + + INBOUND = "Inbound" + OUTBOUND = "Outbound" + + +class TriggeredBuildResultProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of this build result.""" + + QUEUING = "Queuing" + BUILDING = "Building" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + CANCELED = "Canceled" + + +class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of job trigger.""" + + MANUAL = "Manual" + + +class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of the underlying resource to mount as a persistent disk.""" + + AZURE_FILE_VOLUME = "AzureFileVolume" + + +class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The day to run the maintenance job.""" + + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + SUNDAY = "Sunday" diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/models/_models_py3.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/models/_models_py3.py new file mode 100644 index 00000000000..293b2011a0f --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/models/_models_py3.py @@ -0,0 +1,11547 @@ +# coding=utf-8 +# pylint: disable=too-many-lines +# -------------------------------------------------------------------------- +# 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 datetime +import sys +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union + +from ... import _serialization + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object + + +class AcceleratorAuthSetting(_serialization.Model): + """Auth setting payload. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AcceleratorBasicAuthSetting, AcceleratorPublicSetting, AcceleratorSshSetting + + All required parameters must be populated in order to send to server. + + :ivar auth_type: The type of the auth setting. Required. + :vartype auth_type: str + """ + + _validation = { + "auth_type": {"required": True}, + } + + _attribute_map = { + "auth_type": {"key": "authType", "type": "str"}, + } + + _subtype_map = { + "auth_type": { + "BasicAuth": "AcceleratorBasicAuthSetting", + "Public": "AcceleratorPublicSetting", + "SSH": "AcceleratorSshSetting", + } + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.auth_type: Optional[str] = None + + +class AcceleratorBasicAuthSetting(AcceleratorAuthSetting): + """Auth setting for basic auth. + + All required parameters must be populated in order to send to server. + + :ivar auth_type: The type of the auth setting. Required. + :vartype auth_type: str + :ivar ca_cert_resource_id: Resource Id of CA certificate for https URL of Git repository. + :vartype ca_cert_resource_id: str + :ivar username: Username of git repository basic auth. Required. + :vartype username: str + :ivar password: Password of git repository basic auth. + :vartype password: str + """ + + _validation = { + "auth_type": {"required": True}, + "username": {"required": True}, + } + + _attribute_map = { + "auth_type": {"key": "authType", "type": "str"}, + "ca_cert_resource_id": {"key": "caCertResourceId", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + } + + def __init__( + self, *, username: str, ca_cert_resource_id: Optional[str] = None, password: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword ca_cert_resource_id: Resource Id of CA certificate for https URL of Git repository. + :paramtype ca_cert_resource_id: str + :keyword username: Username of git repository basic auth. Required. + :paramtype username: str + :keyword password: Password of git repository basic auth. + :paramtype password: str + """ + super().__init__(**kwargs) + self.auth_type: str = "BasicAuth" + self.ca_cert_resource_id = ca_cert_resource_id + self.username = username + self.password = password + + +class AcceleratorGitRepository(_serialization.Model): + """AcceleratorGitRepository. + + All required parameters must be populated in order to send to server. + + :ivar url: Git repository URL for the accelerator. Required. + :vartype url: str + :ivar interval_in_seconds: Interval for checking for updates to Git or image repository. + :vartype interval_in_seconds: int + :ivar branch: Git repository branch to be used. + :vartype branch: str + :ivar commit: Git repository commit to be used. + :vartype commit: str + :ivar git_tag: Git repository tag to be used. + :vartype git_tag: str + :ivar auth_setting: Properties of the auth setting payload. Required. + :vartype auth_setting: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.AcceleratorAuthSetting + :ivar sub_path: Folder path inside the git repository to consider as the root of the + accelerator or fragment. + :vartype sub_path: str + """ + + _validation = { + "url": {"required": True}, + "auth_setting": {"required": True}, + } + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + "interval_in_seconds": {"key": "intervalInSeconds", "type": "int"}, + "branch": {"key": "branch", "type": "str"}, + "commit": {"key": "commit", "type": "str"}, + "git_tag": {"key": "gitTag", "type": "str"}, + "auth_setting": {"key": "authSetting", "type": "AcceleratorAuthSetting"}, + "sub_path": {"key": "subPath", "type": "str"}, + } + + def __init__( + self, + *, + url: str, + auth_setting: "_models.AcceleratorAuthSetting", + interval_in_seconds: Optional[int] = None, + branch: Optional[str] = None, + commit: Optional[str] = None, + git_tag: Optional[str] = None, + sub_path: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword url: Git repository URL for the accelerator. Required. + :paramtype url: str + :keyword interval_in_seconds: Interval for checking for updates to Git or image repository. + :paramtype interval_in_seconds: int + :keyword branch: Git repository branch to be used. + :paramtype branch: str + :keyword commit: Git repository commit to be used. + :paramtype commit: str + :keyword git_tag: Git repository tag to be used. + :paramtype git_tag: str + :keyword auth_setting: Properties of the auth setting payload. Required. + :paramtype auth_setting: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.AcceleratorAuthSetting + :keyword sub_path: Folder path inside the git repository to consider as the root of the + accelerator or fragment. + :paramtype sub_path: str + """ + super().__init__(**kwargs) + self.url = url + self.interval_in_seconds = interval_in_seconds + self.branch = branch + self.commit = commit + self.git_tag = git_tag + self.auth_setting = auth_setting + self.sub_path = sub_path + + +class AcceleratorPublicSetting(AcceleratorAuthSetting): + """Auth setting for public url. + + All required parameters must be populated in order to send to server. + + :ivar auth_type: The type of the auth setting. Required. + :vartype auth_type: str + :ivar ca_cert_resource_id: Resource Id of CA certificate for https URL of Git repository. + :vartype ca_cert_resource_id: str + """ + + _validation = { + "auth_type": {"required": True}, + } + + _attribute_map = { + "auth_type": {"key": "authType", "type": "str"}, + "ca_cert_resource_id": {"key": "caCertResourceId", "type": "str"}, + } + + def __init__(self, *, ca_cert_resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword ca_cert_resource_id: Resource Id of CA certificate for https URL of Git repository. + :paramtype ca_cert_resource_id: str + """ + super().__init__(**kwargs) + self.auth_type: str = "Public" + self.ca_cert_resource_id = ca_cert_resource_id + + +class AcceleratorSshSetting(AcceleratorAuthSetting): + """Auth setting for SSH auth. + + All required parameters must be populated in order to send to server. + + :ivar auth_type: The type of the auth setting. Required. + :vartype auth_type: str + :ivar host_key: Public SSH Key of git repository. + :vartype host_key: str + :ivar host_key_algorithm: SSH Key algorithm of git repository. + :vartype host_key_algorithm: str + :ivar private_key: Private SSH Key algorithm of git repository. + :vartype private_key: str + """ + + _validation = { + "auth_type": {"required": True}, + } + + _attribute_map = { + "auth_type": {"key": "authType", "type": "str"}, + "host_key": {"key": "hostKey", "type": "str"}, + "host_key_algorithm": {"key": "hostKeyAlgorithm", "type": "str"}, + "private_key": {"key": "privateKey", "type": "str"}, + } + + def __init__( + self, + *, + host_key: Optional[str] = None, + host_key_algorithm: Optional[str] = None, + private_key: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword host_key: Public SSH Key of git repository. + :paramtype host_key: str + :keyword host_key_algorithm: SSH Key algorithm of git repository. + :paramtype host_key_algorithm: str + :keyword private_key: Private SSH Key algorithm of git repository. + :paramtype private_key: str + """ + super().__init__(**kwargs) + self.auth_type: str = "SSH" + self.host_key = host_key + self.host_key_algorithm = host_key_algorithm + self.private_key = private_key + + +class ActiveDeploymentCollection(_serialization.Model): + """Object that includes an array of Deployment resource name and set them as active. + + :ivar active_deployment_names: Collection of Deployment name. + :vartype active_deployment_names: list[str] + """ + + _attribute_map = { + "active_deployment_names": {"key": "activeDeploymentNames", "type": "[str]"}, + } + + def __init__(self, *, active_deployment_names: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword active_deployment_names: Collection of Deployment name. + :paramtype active_deployment_names: list[str] + """ + super().__init__(**kwargs) + self.active_deployment_names = active_deployment_names + + +class ApiPortalCustomDomainProperties(_serialization.Model): + """The properties of custom domain for API portal. + + :ivar thumbprint: The thumbprint of bound certificate. + :vartype thumbprint: str + """ + + _attribute_map = { + "thumbprint": {"key": "thumbprint", "type": "str"}, + } + + def __init__(self, *, thumbprint: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword thumbprint: The thumbprint of bound certificate. + :paramtype thumbprint: str + """ + super().__init__(**kwargs) + self.thumbprint = thumbprint + + +class Resource(_serialization.Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have everything other than + required location and tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + """ + + +class ApiPortalCustomDomainResource(ProxyResource): + """Custom domain of the API portal. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: The properties of custom domain for API portal. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ApiPortalCustomDomainProperties"}, + } + + def __init__( + self, *, properties: Optional["_models.ApiPortalCustomDomainProperties"] = None, **kwargs: Any + ) -> None: + """ + :keyword properties: The properties of custom domain for API portal. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class ApiPortalCustomDomainResourceCollection(_serialization.Model): + """Object that includes an array of API portal custom domain resources and a possible link for + next set. + + :ivar value: Collection of API portal custom domain resources. + :vartype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ApiPortalCustomDomainResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ApiPortalCustomDomainResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of API portal custom domain resources. + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApiPortalInstance(_serialization.Model): + """Collection of instances belong to the API portal. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the API portal instance. + :vartype name: str + :ivar status: Status of the API portal instance. + :vartype status: str + """ + + _validation = { + "name": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.status = None + + +class ApiPortalProperties(_serialization.Model): + """API portal properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: State of the API portal. Known values are: "Creating", "Updating", + "Succeeded", "Failed", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalProvisioningState + :ivar public: Indicates whether the API portal exposes endpoint. + :vartype public: bool + :ivar url: URL of the API portal, exposed when 'public' is true. + :vartype url: str + :ivar https_only: Indicate if only https is allowed. + :vartype https_only: bool + :ivar gateway_ids: The array of resource Ids of gateway to integrate with API portal. + :vartype gateway_ids: list[str] + :ivar source_urls: Collection of OpenAPI source URL locations. + :vartype source_urls: list[str] + :ivar sso_properties: Single sign-on related configuration. + :vartype sso_properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SsoProperties + :ivar resource_requests: The requested resource quantity for required CPU and Memory. + :vartype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResourceRequests + :ivar instances: Collection of instances belong to API portal. + :vartype instances: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalInstance] + :ivar api_try_out_enabled_state: Indicates whether the API try-out feature is enabled or + disabled. When enabled, users can try out the API by sending requests and viewing responses in + API portal. When disabled, users cannot try out the API. Known values are: "Enabled" and + "Disabled". + :vartype api_try_out_enabled_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalApiTryOutEnabledState + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "url": {"readonly": True}, + "resource_requests": {"readonly": True}, + "instances": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "public": {"key": "public", "type": "bool"}, + "url": {"key": "url", "type": "str"}, + "https_only": {"key": "httpsOnly", "type": "bool"}, + "gateway_ids": {"key": "gatewayIds", "type": "[str]"}, + "source_urls": {"key": "sourceUrls", "type": "[str]"}, + "sso_properties": {"key": "ssoProperties", "type": "SsoProperties"}, + "resource_requests": {"key": "resourceRequests", "type": "ApiPortalResourceRequests"}, + "instances": {"key": "instances", "type": "[ApiPortalInstance]"}, + "api_try_out_enabled_state": {"key": "apiTryOutEnabledState", "type": "str"}, + } + + def __init__( + self, + *, + public: bool = False, + https_only: bool = False, + gateway_ids: Optional[List[str]] = None, + source_urls: Optional[List[str]] = None, + sso_properties: Optional["_models.SsoProperties"] = None, + api_try_out_enabled_state: Union[str, "_models.ApiPortalApiTryOutEnabledState"] = "Enabled", + **kwargs: Any + ) -> None: + """ + :keyword public: Indicates whether the API portal exposes endpoint. + :paramtype public: bool + :keyword https_only: Indicate if only https is allowed. + :paramtype https_only: bool + :keyword gateway_ids: The array of resource Ids of gateway to integrate with API portal. + :paramtype gateway_ids: list[str] + :keyword source_urls: Collection of OpenAPI source URL locations. + :paramtype source_urls: list[str] + :keyword sso_properties: Single sign-on related configuration. + :paramtype sso_properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SsoProperties + :keyword api_try_out_enabled_state: Indicates whether the API try-out feature is enabled or + disabled. When enabled, users can try out the API by sending requests and viewing responses in + API portal. When disabled, users cannot try out the API. Known values are: "Enabled" and + "Disabled". + :paramtype api_try_out_enabled_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalApiTryOutEnabledState + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.public = public + self.url = None + self.https_only = https_only + self.gateway_ids = gateway_ids + self.source_urls = source_urls + self.sso_properties = sso_properties + self.resource_requests = None + self.instances = None + self.api_try_out_enabled_state = api_try_out_enabled_state + + +class ApiPortalResource(ProxyResource): + """API portal resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: API portal properties payload. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalProperties + :ivar sku: Sku of the API portal resource. + :vartype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ApiPortalProperties"}, + "sku": {"key": "sku", "type": "Sku"}, + } + + def __init__( + self, + *, + properties: Optional["_models.ApiPortalProperties"] = None, + sku: Optional["_models.Sku"] = None, + **kwargs: Any + ) -> None: + """ + :keyword properties: API portal properties payload. + :paramtype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalProperties + :keyword sku: Sku of the API portal resource. + :paramtype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + super().__init__(**kwargs) + self.properties = properties + self.sku = sku + + +class ApiPortalResourceCollection(_serialization.Model): + """Object that includes an array of API portal resources and a possible link for next set. + + :ivar value: Collection of API portal resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ApiPortalResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ApiPortalResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of API portal resources. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApiPortalResourceRequests(_serialization.Model): + """Resource requests of the API portal. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cpu: CPU allocated to each API portal instance. + :vartype cpu: str + :ivar memory: Memory allocated to each API portal instance. + :vartype memory: str + """ + + _validation = { + "cpu": {"readonly": True}, + "memory": {"readonly": True}, + } + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.cpu = None + self.memory = None + + +class ApmProperties(_serialization.Model): + """Properties of an APM. + + 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 server. + + :ivar type: APM Type. Required. + :vartype type: str + :ivar provisioning_state: State of the APM. Known values are: "Creating", "Updating", + "Succeeded", "Failed", "Deleting", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmProvisioningState + :ivar properties: Non-sensitive properties for the APM. + :vartype properties: dict[str, str] + :ivar secrets: Sensitive properties for the APM. + :vartype secrets: dict[str, str] + """ + + _validation = { + "type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "secrets": {"key": "secrets", "type": "{str}"}, + } + + def __init__( + self, + *, + type: str, + properties: Optional[Dict[str, str]] = None, + secrets: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: APM Type. Required. + :paramtype type: str + :keyword properties: Non-sensitive properties for the APM. + :paramtype properties: dict[str, str] + :keyword secrets: Sensitive properties for the APM. + :paramtype secrets: dict[str, str] + """ + super().__init__(**kwargs) + self.type = type + self.provisioning_state = None + self.properties = properties + self.secrets = secrets + + +class ApmReference(_serialization.Model): + """A reference to the APM. + + All required parameters must be populated in order to send to server. + + :ivar resource_id: Resource Id of the APM. Required. + :vartype resource_id: str + """ + + _validation = { + "resource_id": {"required": True}, + } + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + } + + def __init__(self, *, resource_id: str, **kwargs: Any) -> None: + """ + :keyword resource_id: Resource Id of the APM. Required. + :paramtype resource_id: str + """ + super().__init__(**kwargs) + self.resource_id = resource_id + + +class ApmResource(ProxyResource): + """APM Resource object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of an APM. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ApmProperties"}, + } + + def __init__(self, *, properties: Optional["_models.ApmProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of an APM. + :paramtype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class ApmResourceCollection(_serialization.Model): + """Object that includes an array of APM resources and a possible link for next set. + + :ivar value: Collection of APM resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ApmResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.ApmResource"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of APM resources. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApmSecretKeys(_serialization.Model): + """Keys of APM sensitive properties. + + :ivar value: Collection of the keys for the APM sensitive properties. + :vartype value: list[str] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[str]"}, + } + + def __init__(self, *, value: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword value: Collection of the keys for the APM sensitive properties. + :paramtype value: list[str] + """ + super().__init__(**kwargs) + self.value = value + + +class ApplicationAcceleratorComponent(_serialization.Model): + """ApplicationAcceleratorComponent. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: + :vartype name: str + :ivar resource_requests: + :vartype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResourceRequests + :ivar instances: + :vartype instances: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorInstance] + """ + + _validation = { + "name": {"readonly": True}, + "instances": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "resource_requests": {"key": "resourceRequests", "type": "ApplicationAcceleratorResourceRequests"}, + "instances": {"key": "instances", "type": "[ApplicationAcceleratorInstance]"}, + } + + def __init__( + self, *, resource_requests: Optional["_models.ApplicationAcceleratorResourceRequests"] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_requests: + :paramtype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResourceRequests + """ + super().__init__(**kwargs) + self.name = None + self.resource_requests = resource_requests + self.instances = None + + +class ApplicationAcceleratorInstance(_serialization.Model): + """ApplicationAcceleratorInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the Application Accelerator instance. + :vartype name: str + :ivar status: Status of the Application Accelerator instance. It can be Pending, Running, + Succeeded, Failed, Unknown. + :vartype status: str + """ + + _validation = { + "name": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.status = None + + +class ApplicationAcceleratorProperties(_serialization.Model): + """Application accelerator properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: State of the application accelerator. Known values are: "Creating", + "Updating", "Succeeded", "Failed", "Deleting", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorProvisioningState + :ivar components: Collection of components belong to application accelerator. + :vartype components: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorComponent] + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "components": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "components": {"key": "components", "type": "[ApplicationAcceleratorComponent]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.provisioning_state = None + self.components = None + + +class ApplicationAcceleratorResource(ProxyResource): + """Application accelerator resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Application accelerator properties payload. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorProperties + :ivar sku: Sku of the application accelerator resource. + :vartype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ApplicationAcceleratorProperties"}, + "sku": {"key": "sku", "type": "Sku"}, + } + + def __init__( + self, + *, + properties: Optional["_models.ApplicationAcceleratorProperties"] = None, + sku: Optional["_models.Sku"] = None, + **kwargs: Any + ) -> None: + """ + :keyword properties: Application accelerator properties payload. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorProperties + :keyword sku: Sku of the application accelerator resource. + :paramtype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + super().__init__(**kwargs) + self.properties = properties + self.sku = sku + + +class ApplicationAcceleratorResourceCollection(_serialization.Model): + """Object that includes an array of application accelerator resources and a possible link for next + set. + + :ivar value: Collection of application accelerator resources. + :vartype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ApplicationAcceleratorResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ApplicationAcceleratorResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of application accelerator resources. + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApplicationAcceleratorResourceRequests(_serialization.Model): + """ApplicationAcceleratorResourceRequests. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cpu: CPU allocated to each application accelerator component. 1 core can be represented + by 1 or 1000m. + :vartype cpu: str + :ivar memory: Memory allocated to each application accelerator component. 1 GB can be + represented by 1Gi or 1024Mi. + :vartype memory: str + :ivar instance_count: Instance count of the application accelerator component. + :vartype instance_count: int + """ + + _validation = { + "cpu": {"readonly": True}, + "memory": {"readonly": True}, + "instance_count": {"readonly": True}, + } + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.cpu = None + self.memory = None + self.instance_count = None + + +class ApplicationInsightsAgentVersions(_serialization.Model): + """Application Insights agent versions properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar java: Indicates the version of application insight java agent. + :vartype java: str + """ + + _validation = { + "java": {"readonly": True}, + } + + _attribute_map = { + "java": {"key": "java", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.java = None + + +class ApplicationLiveViewComponent(_serialization.Model): + """Application Live View properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the component. + :vartype name: any + :ivar resource_requests: The requested resource quantity for required CPU and Memory. + :vartype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResourceRequests + :ivar instances: Collection of instances belong to Application Live View. + :vartype instances: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewInstance] + """ + + _validation = { + "name": {"readonly": True}, + "resource_requests": {"readonly": True}, + "instances": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "object"}, + "resource_requests": {"key": "resourceRequests", "type": "ApplicationLiveViewResourceRequests"}, + "instances": {"key": "instances", "type": "[ApplicationLiveViewInstance]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.resource_requests = None + self.instances = None + + +class ApplicationLiveViewInstance(_serialization.Model): + """Collection of instances belong to the Application Live View. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the Application Live View instance. + :vartype name: str + :ivar status: Status of the Application Live View instance. It can be Pending, Running, + Succeeded, Failed, Unknown. + :vartype status: str + """ + + _validation = { + "name": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.status = None + + +class ApplicationLiveViewProperties(_serialization.Model): + """Application Live View properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: State of the Application Live View. Known values are: "Creating", + "Updating", "Succeeded", "Failed", "Deleting", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewProvisioningState + :ivar components: Component details of Application Live View. + :vartype components: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewComponent] + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "components": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "components": {"key": "components", "type": "[ApplicationLiveViewComponent]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.provisioning_state = None + self.components = None + + +class ApplicationLiveViewResource(ProxyResource): + """Application Live View resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Application Live View properties payload. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ApplicationLiveViewProperties"}, + } + + def __init__(self, *, properties: Optional["_models.ApplicationLiveViewProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Application Live View properties payload. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class ApplicationLiveViewResourceCollection(_serialization.Model): + """Object that includes an array of Application Live View resources and a possible link for next + set. + + :ivar value: Collection of Application Live View resources. + :vartype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ApplicationLiveViewResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ApplicationLiveViewResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Application Live View resources. + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApplicationLiveViewResourceRequests(_serialization.Model): + """The resource quantity for required CPU and Memory of Application Live View component. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cpu: Cpu quantity allocated to each Application Live View component instance. 1 core can + be represented by 1 or 1000m. + :vartype cpu: str + :ivar memory: Memory quantity allocated to each Application Live View component instance. 1 GB + can be represented by 1Gi or 1024Mi. + :vartype memory: str + :ivar instance_count: Desired instance count of Application Live View component instance. + :vartype instance_count: int + """ + + _validation = { + "cpu": {"readonly": True}, + "memory": {"readonly": True}, + "instance_count": {"readonly": True}, + } + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.cpu = None + self.memory = None + self.instance_count = None + + +class AppResource(ProxyResource): + """App resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of the App resource. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResourceProperties + :ivar identity: The Managed Identity type of the app resource. + :vartype identity: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ManagedIdentityProperties + :ivar location: The GEO location of the application, always the same with its parent resource. + :vartype location: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "AppResourceProperties"}, + "identity": {"key": "identity", "type": "ManagedIdentityProperties"}, + "location": {"key": "location", "type": "str"}, + } + + def __init__( + self, + *, + properties: Optional["_models.AppResourceProperties"] = None, + identity: Optional["_models.ManagedIdentityProperties"] = None, + location: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword properties: Properties of the App resource. + :paramtype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResourceProperties + :keyword identity: The Managed Identity type of the app resource. + :paramtype identity: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ManagedIdentityProperties + :keyword location: The GEO location of the application, always the same with its parent + resource. + :paramtype location: str + """ + super().__init__(**kwargs) + self.properties = properties + self.identity = identity + self.location = location + + +class AppResourceCollection(_serialization.Model): + """Object that includes an array of App resources and a possible link for next set. + + :ivar value: Collection of App resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[AppResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.AppResource"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of App resources. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class AppResourceProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes + """App resource properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar public: Indicates whether the App exposes public endpoint. + :vartype public: bool + :ivar url: URL of the App. + :vartype url: str + :ivar addon_configs: Collection of addons. + :vartype addon_configs: dict[str, JSON] + :ivar provisioning_state: Provisioning state of the App. Known values are: "Succeeded", + "Failed", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResourceProvisioningState + :ivar fqdn: Fully qualified dns Name. + :vartype fqdn: str + :ivar https_only: Indicate if only https is allowed. + :vartype https_only: bool + :ivar temporary_disk: Temporary disk settings. + :vartype temporary_disk: ~azure.mgmt.appplatform.v2024_05_01_preview.models.TemporaryDisk + :ivar persistent_disk: Persistent disk settings. + :vartype persistent_disk: ~azure.mgmt.appplatform.v2024_05_01_preview.models.PersistentDisk + :ivar custom_persistent_disks: List of custom persistent disks. + :vartype custom_persistent_disks: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomPersistentDiskResource] + :ivar enable_end_to_end_tls: Indicate if end to end TLS is enabled. + :vartype enable_end_to_end_tls: bool + :ivar loaded_certificates: Collection of loaded certificates. + :vartype loaded_certificates: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.LoadedCertificate] + :ivar vnet_addons: Additional App settings in vnet injection instance. + :vartype vnet_addons: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppVNetAddons + :ivar ingress_settings: App ingress settings payload. + :vartype ingress_settings: ~azure.mgmt.appplatform.v2024_05_01_preview.models.IngressSettings + :ivar secrets: Collection of auth secrets. + :vartype secrets: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.Secret] + :ivar workload_profile_name: The workload profile used for this app. Supported for Consumption + + Dedicated plan. + :vartype workload_profile_name: str + :ivar test_endpoint_auth_state: State of test endpoint auth. Known values are: "Enabled" and + "Disabled". + :vartype test_endpoint_auth_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.TestEndpointAuthState + """ + + _validation = { + "url": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "fqdn": {"readonly": True}, + } + + _attribute_map = { + "public": {"key": "public", "type": "bool"}, + "url": {"key": "url", "type": "str"}, + "addon_configs": {"key": "addonConfigs", "type": "{object}"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "fqdn": {"key": "fqdn", "type": "str"}, + "https_only": {"key": "httpsOnly", "type": "bool"}, + "temporary_disk": {"key": "temporaryDisk", "type": "TemporaryDisk"}, + "persistent_disk": {"key": "persistentDisk", "type": "PersistentDisk"}, + "custom_persistent_disks": {"key": "customPersistentDisks", "type": "[CustomPersistentDiskResource]"}, + "enable_end_to_end_tls": {"key": "enableEndToEndTLS", "type": "bool"}, + "loaded_certificates": {"key": "loadedCertificates", "type": "[LoadedCertificate]"}, + "vnet_addons": {"key": "vnetAddons", "type": "AppVNetAddons"}, + "ingress_settings": {"key": "ingressSettings", "type": "IngressSettings"}, + "secrets": {"key": "secrets", "type": "[Secret]"}, + "workload_profile_name": {"key": "workloadProfileName", "type": "str"}, + "test_endpoint_auth_state": {"key": "testEndpointAuthState", "type": "str"}, + } + + def __init__( + self, + *, + public: Optional[bool] = None, + addon_configs: Optional[Dict[str, JSON]] = None, + https_only: bool = False, + temporary_disk: Optional["_models.TemporaryDisk"] = None, + persistent_disk: Optional["_models.PersistentDisk"] = None, + custom_persistent_disks: Optional[List["_models.CustomPersistentDiskResource"]] = None, + enable_end_to_end_tls: bool = False, + loaded_certificates: Optional[List["_models.LoadedCertificate"]] = None, + vnet_addons: Optional["_models.AppVNetAddons"] = None, + ingress_settings: Optional["_models.IngressSettings"] = None, + secrets: Optional[List["_models.Secret"]] = None, + workload_profile_name: Optional[str] = None, + test_endpoint_auth_state: Union[str, "_models.TestEndpointAuthState"] = "Enabled", + **kwargs: Any + ) -> None: + """ + :keyword public: Indicates whether the App exposes public endpoint. + :paramtype public: bool + :keyword addon_configs: Collection of addons. + :paramtype addon_configs: dict[str, JSON] + :keyword https_only: Indicate if only https is allowed. + :paramtype https_only: bool + :keyword temporary_disk: Temporary disk settings. + :paramtype temporary_disk: ~azure.mgmt.appplatform.v2024_05_01_preview.models.TemporaryDisk + :keyword persistent_disk: Persistent disk settings. + :paramtype persistent_disk: ~azure.mgmt.appplatform.v2024_05_01_preview.models.PersistentDisk + :keyword custom_persistent_disks: List of custom persistent disks. + :paramtype custom_persistent_disks: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomPersistentDiskResource] + :keyword enable_end_to_end_tls: Indicate if end to end TLS is enabled. + :paramtype enable_end_to_end_tls: bool + :keyword loaded_certificates: Collection of loaded certificates. + :paramtype loaded_certificates: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.LoadedCertificate] + :keyword vnet_addons: Additional App settings in vnet injection instance. + :paramtype vnet_addons: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppVNetAddons + :keyword ingress_settings: App ingress settings payload. + :paramtype ingress_settings: ~azure.mgmt.appplatform.v2024_05_01_preview.models.IngressSettings + :keyword secrets: Collection of auth secrets. + :paramtype secrets: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.Secret] + :keyword workload_profile_name: The workload profile used for this app. Supported for + Consumption + Dedicated plan. + :paramtype workload_profile_name: str + :keyword test_endpoint_auth_state: State of test endpoint auth. Known values are: "Enabled" and + "Disabled". + :paramtype test_endpoint_auth_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.TestEndpointAuthState + """ + super().__init__(**kwargs) + self.public = public + self.url = None + self.addon_configs = addon_configs + self.provisioning_state = None + self.fqdn = None + self.https_only = https_only + self.temporary_disk = temporary_disk + self.persistent_disk = persistent_disk + self.custom_persistent_disks = custom_persistent_disks + self.enable_end_to_end_tls = enable_end_to_end_tls + self.loaded_certificates = loaded_certificates + self.vnet_addons = vnet_addons + self.ingress_settings = ingress_settings + self.secrets = secrets + self.workload_profile_name = workload_profile_name + self.test_endpoint_auth_state = test_endpoint_auth_state + + +class AppVNetAddons(_serialization.Model): + """Additional App settings in vnet injection instance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar public_endpoint: Indicates whether the App in vnet injection instance exposes endpoint + which could be accessed from internet. + :vartype public_endpoint: bool + :ivar public_endpoint_url: URL of the App in vnet injection instance which could be accessed + from internet. + :vartype public_endpoint_url: str + """ + + _validation = { + "public_endpoint_url": {"readonly": True}, + } + + _attribute_map = { + "public_endpoint": {"key": "publicEndpoint", "type": "bool"}, + "public_endpoint_url": {"key": "publicEndpointUrl", "type": "str"}, + } + + def __init__(self, *, public_endpoint: bool = False, **kwargs: Any) -> None: + """ + :keyword public_endpoint: Indicates whether the App in vnet injection instance exposes endpoint + which could be accessed from internet. + :paramtype public_endpoint: bool + """ + super().__init__(**kwargs) + self.public_endpoint = public_endpoint + self.public_endpoint_url = None + + +class AvailableOperations(_serialization.Model): + """Available operations of the service. + + :ivar value: Collection of available operation details. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.OperationDetail] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[OperationDetail]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.OperationDetail"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of available operation details. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.OperationDetail] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class AvailableRuntimeVersions(_serialization.Model): + """AvailableRuntimeVersions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of all supported runtime versions. + :vartype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedRuntimeVersion] + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[SupportedRuntimeVersion]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + + +class CustomPersistentDiskProperties(_serialization.Model): + """Custom persistent disk resource payload. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureFileVolume + + All required parameters must be populated in order to send to server. + + :ivar type: The type of the underlying resource to mount as a persistent disk. Required. + "AzureFileVolume" + :vartype type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.Type + :ivar mount_path: The mount path of the persistent disk. Required. + :vartype mount_path: str + :ivar read_only: Indicates whether the persistent disk is a readOnly one. + :vartype read_only: bool + :ivar enable_sub_path: If set to true, it will create and mount a dedicated directory for every + individual app instance. + :vartype enable_sub_path: bool + :ivar mount_options: These are the mount options for a persistent disk. + :vartype mount_options: list[str] + """ + + _validation = { + "type": {"required": True}, + "mount_path": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "read_only": {"key": "readOnly", "type": "bool"}, + "enable_sub_path": {"key": "enableSubPath", "type": "bool"}, + "mount_options": {"key": "mountOptions", "type": "[str]"}, + } + + _subtype_map = {"type": {"AzureFileVolume": "AzureFileVolume"}} + + def __init__( + self, + *, + mount_path: str, + read_only: Optional[bool] = None, + enable_sub_path: bool = False, + mount_options: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword mount_path: The mount path of the persistent disk. Required. + :paramtype mount_path: str + :keyword read_only: Indicates whether the persistent disk is a readOnly one. + :paramtype read_only: bool + :keyword enable_sub_path: If set to true, it will create and mount a dedicated directory for + every individual app instance. + :paramtype enable_sub_path: bool + :keyword mount_options: These are the mount options for a persistent disk. + :paramtype mount_options: list[str] + """ + super().__init__(**kwargs) + self.type: Optional[str] = None + self.mount_path = mount_path + self.read_only = read_only + self.enable_sub_path = enable_sub_path + self.mount_options = mount_options + + +class AzureFileVolume(CustomPersistentDiskProperties): + """The properties of the Azure File volume. Azure File shares are mounted as volumes. + + All required parameters must be populated in order to send to server. + + :ivar type: The type of the underlying resource to mount as a persistent disk. Required. + "AzureFileVolume" + :vartype type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.Type + :ivar mount_path: The mount path of the persistent disk. Required. + :vartype mount_path: str + :ivar read_only: Indicates whether the persistent disk is a readOnly one. + :vartype read_only: bool + :ivar enable_sub_path: If set to true, it will create and mount a dedicated directory for every + individual app instance. + :vartype enable_sub_path: bool + :ivar mount_options: These are the mount options for a persistent disk. + :vartype mount_options: list[str] + :ivar share_name: The share name of the Azure File share. + :vartype share_name: str + """ + + _validation = { + "type": {"required": True}, + "mount_path": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "read_only": {"key": "readOnly", "type": "bool"}, + "enable_sub_path": {"key": "enableSubPath", "type": "bool"}, + "mount_options": {"key": "mountOptions", "type": "[str]"}, + "share_name": {"key": "shareName", "type": "str"}, + } + + def __init__( + self, + *, + mount_path: str, + read_only: Optional[bool] = None, + enable_sub_path: bool = False, + mount_options: Optional[List[str]] = None, + share_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword mount_path: The mount path of the persistent disk. Required. + :paramtype mount_path: str + :keyword read_only: Indicates whether the persistent disk is a readOnly one. + :paramtype read_only: bool + :keyword enable_sub_path: If set to true, it will create and mount a dedicated directory for + every individual app instance. + :paramtype enable_sub_path: bool + :keyword mount_options: These are the mount options for a persistent disk. + :paramtype mount_options: list[str] + :keyword share_name: The share name of the Azure File share. + :paramtype share_name: str + """ + super().__init__( + mount_path=mount_path, + read_only=read_only, + enable_sub_path=enable_sub_path, + mount_options=mount_options, + **kwargs + ) + self.type: str = "AzureFileVolume" + self.share_name = share_name + + +class BindingResource(ProxyResource): + """Binding resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of the Binding resource. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResourceProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "BindingResourceProperties"}, + } + + def __init__(self, *, properties: Optional["_models.BindingResourceProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of the Binding resource. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResourceProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class BindingResourceCollection(_serialization.Model): + """Object that includes an array of Binding resources and a possible link for next set. + + :ivar value: Collection of Binding resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[BindingResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.BindingResource"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Binding resources. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BindingResourceProperties(_serialization.Model): + """Binding resource properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_name: The name of the bound resource. + :vartype resource_name: str + :ivar resource_type: The standard Azure resource type of the bound resource. + :vartype resource_type: str + :ivar resource_id: The Azure resource id of the bound resource. + :vartype resource_id: str + :ivar key: The key of the bound resource. + :vartype key: str + :ivar binding_parameters: Binding parameters of the Binding resource. + :vartype binding_parameters: dict[str, str] + :ivar generated_properties: The generated Spring Boot property file for this binding. The + secret will be deducted. + :vartype generated_properties: str + :ivar created_at: Creation time of the Binding resource. + :vartype created_at: str + :ivar updated_at: Update time of the Binding resource. + :vartype updated_at: str + """ + + _validation = { + "resource_name": {"readonly": True}, + "resource_type": {"readonly": True}, + "generated_properties": {"readonly": True}, + "created_at": {"readonly": True}, + "updated_at": {"readonly": True}, + } + + _attribute_map = { + "resource_name": {"key": "resourceName", "type": "str"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "binding_parameters": {"key": "bindingParameters", "type": "{str}"}, + "generated_properties": {"key": "generatedProperties", "type": "str"}, + "created_at": {"key": "createdAt", "type": "str"}, + "updated_at": {"key": "updatedAt", "type": "str"}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + key: Optional[str] = None, + binding_parameters: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword resource_id: The Azure resource id of the bound resource. + :paramtype resource_id: str + :keyword key: The key of the bound resource. + :paramtype key: str + :keyword binding_parameters: Binding parameters of the Binding resource. + :paramtype binding_parameters: dict[str, str] + """ + super().__init__(**kwargs) + self.resource_name = None + self.resource_type = None + self.resource_id = resource_id + self.key = key + self.binding_parameters = binding_parameters + self.generated_properties = None + self.created_at = None + self.updated_at = None + + +class Build(ProxyResource): + """Build resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of the build resource. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "BuildProperties"}, + } + + def __init__(self, *, properties: Optional["_models.BuildProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of the build resource. + :paramtype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class BuildCollection(_serialization.Model): + """Object that includes an array of Build resources and a possible link for next set. + + :ivar value: Collection of Build resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.Build] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[Build]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.Build"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Build resources. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.Build] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BuilderProperties(_serialization.Model): + """KPack Builder properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: Builder provision status. Known values are: "Creating", "Updating", + "Succeeded", "Failed", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderProvisioningState + :ivar stack: Builder cluster stack property. + :vartype stack: ~azure.mgmt.appplatform.v2024_05_01_preview.models.StackProperties + :ivar buildpack_groups: Builder buildpack groups. + :vartype buildpack_groups: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpacksGroupProperties] + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "stack": {"key": "stack", "type": "StackProperties"}, + "buildpack_groups": {"key": "buildpackGroups", "type": "[BuildpacksGroupProperties]"}, + } + + def __init__( + self, + *, + stack: Optional["_models.StackProperties"] = None, + buildpack_groups: Optional[List["_models.BuildpacksGroupProperties"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword stack: Builder cluster stack property. + :paramtype stack: ~azure.mgmt.appplatform.v2024_05_01_preview.models.StackProperties + :keyword buildpack_groups: Builder buildpack groups. + :paramtype buildpack_groups: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpacksGroupProperties] + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.stack = stack + self.buildpack_groups = buildpack_groups + + +class BuilderResource(ProxyResource): + """KPack Builder resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Property of the Builder resource. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "BuilderProperties"}, + } + + def __init__(self, *, properties: Optional["_models.BuilderProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Property of the Builder resource. + :paramtype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class BuilderResourceCollection(_serialization.Model): + """Object that includes an array of Builder resources and a possible link for next set. + + :ivar value: Collection of Builder resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[BuilderResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.BuilderResource"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Builder resources. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BuildpackBindingLaunchProperties(_serialization.Model): + """Buildpack Binding Launch Properties. + + :ivar properties: Non-sensitive properties for launchProperties. + :vartype properties: dict[str, str] + :ivar secrets: Sensitive properties for launchProperties. + :vartype secrets: dict[str, str] + """ + + _attribute_map = { + "properties": {"key": "properties", "type": "{str}"}, + "secrets": {"key": "secrets", "type": "{str}"}, + } + + def __init__( + self, *, properties: Optional[Dict[str, str]] = None, secrets: Optional[Dict[str, str]] = None, **kwargs: Any + ) -> None: + """ + :keyword properties: Non-sensitive properties for launchProperties. + :paramtype properties: dict[str, str] + :keyword secrets: Sensitive properties for launchProperties. + :paramtype secrets: dict[str, str] + """ + super().__init__(**kwargs) + self.properties = properties + self.secrets = secrets + + +class BuildpackBindingProperties(_serialization.Model): + """Properties of a buildpack binding. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar binding_type: Buildpack Binding Type. Known values are: "ApplicationInsights", + "ApacheSkyWalking", "AppDynamics", "Dynatrace", "NewRelic", "ElasticAPM", and "CACertificates". + :vartype binding_type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingType + :ivar provisioning_state: State of the Buildpack Binding. Known values are: "Creating", + "Updating", "Succeeded", "Failed", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingProvisioningState + :ivar launch_properties: The object describes the buildpack binding launch properties. + :vartype launch_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingLaunchProperties + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "binding_type": {"key": "bindingType", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "launch_properties": {"key": "launchProperties", "type": "BuildpackBindingLaunchProperties"}, + } + + def __init__( + self, + *, + binding_type: Optional[Union[str, "_models.BindingType"]] = None, + launch_properties: Optional["_models.BuildpackBindingLaunchProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword binding_type: Buildpack Binding Type. Known values are: "ApplicationInsights", + "ApacheSkyWalking", "AppDynamics", "Dynatrace", "NewRelic", "ElasticAPM", and "CACertificates". + :paramtype binding_type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingType + :keyword launch_properties: The object describes the buildpack binding launch properties. + :paramtype launch_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingLaunchProperties + """ + super().__init__(**kwargs) + self.binding_type = binding_type + self.provisioning_state = None + self.launch_properties = launch_properties + + +class BuildpackBindingResource(ProxyResource): + """Buildpack Binding Resource object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of a buildpack binding. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "BuildpackBindingProperties"}, + } + + def __init__(self, *, properties: Optional["_models.BuildpackBindingProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of a buildpack binding. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class BuildpackBindingResourceCollection(_serialization.Model): + """Object that includes an array of BuildpackBinding resources and a possible link for next set. + + :ivar value: Collection of BuildpackBinding resources. + :vartype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[BuildpackBindingResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.BuildpackBindingResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of BuildpackBinding resources. + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BuildpackProperties(_serialization.Model): + """Buildpack properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Id of the buildpack. + :vartype id: str + :ivar version: Version of the buildpack. + :vartype version: str + """ + + _validation = { + "version": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "version": {"key": "version", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: Id of the buildpack. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + self.version = None + + +class BuildpacksGroupProperties(_serialization.Model): + """Buildpack group properties of the Builder. + + :ivar name: Buildpack group name. + :vartype name: str + :ivar buildpacks: Buildpacks in the buildpack group. + :vartype buildpacks: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackProperties] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "buildpacks": {"key": "buildpacks", "type": "[BuildpackProperties]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + buildpacks: Optional[List["_models.BuildpackProperties"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Buildpack group name. + :paramtype name: str + :keyword buildpacks: Buildpacks in the buildpack group. + :paramtype buildpacks: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackProperties] + """ + super().__init__(**kwargs) + self.name = name + self.buildpacks = buildpacks + + +class BuildProperties(_serialization.Model): + """Build resource properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar relative_path: The relative path of source code. + :vartype relative_path: str + :ivar builder: The resource id of builder to build the source code. + :vartype builder: str + :ivar agent_pool: The resource id of agent pool. + :vartype agent_pool: str + :ivar provisioning_state: Provisioning state of the KPack build result. Known values are: + "Creating", "Updating", "Succeeded", "Failed", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildProvisioningState + :ivar env: The environment variables for this build. + :vartype env: dict[str, str] + :ivar apms: The APMs for this build. + :vartype apms: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmReference] + :ivar certificates: The CA Certificates for this build. + :vartype certificates: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateReference] + :ivar triggered_build_result: The build result triggered by this build. + :vartype triggered_build_result: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.TriggeredBuildResult + :ivar resource_requests: The customized build resource for this build. + :vartype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildResourceRequests + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "triggered_build_result": {"readonly": True}, + } + + _attribute_map = { + "relative_path": {"key": "relativePath", "type": "str"}, + "builder": {"key": "builder", "type": "str"}, + "agent_pool": {"key": "agentPool", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "env": {"key": "env", "type": "{str}"}, + "apms": {"key": "apms", "type": "[ApmReference]"}, + "certificates": {"key": "certificates", "type": "[CertificateReference]"}, + "triggered_build_result": {"key": "triggeredBuildResult", "type": "TriggeredBuildResult"}, + "resource_requests": {"key": "resourceRequests", "type": "BuildResourceRequests"}, + } + + def __init__( + self, + *, + relative_path: Optional[str] = None, + builder: Optional[str] = None, + agent_pool: Optional[str] = None, + env: Optional[Dict[str, str]] = None, + apms: Optional[List["_models.ApmReference"]] = None, + certificates: Optional[List["_models.CertificateReference"]] = None, + resource_requests: Optional["_models.BuildResourceRequests"] = None, + **kwargs: Any + ) -> None: + """ + :keyword relative_path: The relative path of source code. + :paramtype relative_path: str + :keyword builder: The resource id of builder to build the source code. + :paramtype builder: str + :keyword agent_pool: The resource id of agent pool. + :paramtype agent_pool: str + :keyword env: The environment variables for this build. + :paramtype env: dict[str, str] + :keyword apms: The APMs for this build. + :paramtype apms: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmReference] + :keyword certificates: The CA Certificates for this build. + :paramtype certificates: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateReference] + :keyword resource_requests: The customized build resource for this build. + :paramtype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildResourceRequests + """ + super().__init__(**kwargs) + self.relative_path = relative_path + self.builder = builder + self.agent_pool = agent_pool + self.provisioning_state = None + self.env = env + self.apms = apms + self.certificates = certificates + self.triggered_build_result = None + self.resource_requests = resource_requests + + +class BuildResourceRequests(_serialization.Model): + """Resource request payload of Build Resource. + + :ivar cpu: Optional Cpu allocated to the build resource. 1 core can be represented by 1 or + 1000m. + The default value is 1, this should not exceed build service agent pool cpu size. + :vartype cpu: str + :ivar memory: Optional Memory allocated to the build resource. 1 GB can be represented by 1Gi + or 1024Mi. + The default value is 2Gi, this should not exceed build service agent pool memory size. + :vartype memory: str + """ + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + } + + def __init__(self, *, cpu: str = "1", memory: str = "2Gi", **kwargs: Any) -> None: + """ + :keyword cpu: Optional Cpu allocated to the build resource. 1 core can be represented by 1 or + 1000m. + The default value is 1, this should not exceed build service agent pool cpu size. + :paramtype cpu: str + :keyword memory: Optional Memory allocated to the build resource. 1 GB can be represented by + 1Gi or 1024Mi. + The default value is 2Gi, this should not exceed build service agent pool memory size. + :paramtype memory: str + """ + super().__init__(**kwargs) + self.cpu = cpu + self.memory = memory + + +class BuildResult(ProxyResource): + """Build result resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of the build result resource. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildResultProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "BuildResultProperties"}, + } + + def __init__(self, *, properties: Optional["_models.BuildResultProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of the build result resource. + :paramtype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildResultProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class BuildResultCollection(_serialization.Model): + """Object that includes an array of Build result resources and a possible link for next set. + + :ivar value: Collection of Build result resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildResult] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[BuildResult]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.BuildResult"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Build result resources. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildResult] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BuildResultLog(_serialization.Model): + """Build result log resource properties payload. + + :ivar blob_url: The public download URL of this build result log. + :vartype blob_url: str + """ + + _attribute_map = { + "blob_url": {"key": "blobUrl", "type": "str"}, + } + + def __init__(self, *, blob_url: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword blob_url: The public download URL of this build result log. + :paramtype blob_url: str + """ + super().__init__(**kwargs) + self.blob_url = blob_url + + +class BuildResultProperties(_serialization.Model): + """Build result resource properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of this build result. + :vartype name: str + :ivar provisioning_state: Provisioning state of the KPack build result. Known values are: + "Queuing", "Building", "Succeeded", "Failed", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildResultProvisioningState + :ivar error: Error when build is failed. + :vartype error: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Error + :ivar build_pod_name: The build pod name which can be used to get the build log streaming. + :vartype build_pod_name: str + :ivar build_stages: All of the build stage (init-container and container) resources in build + pod. + :vartype build_stages: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildStageProperties] + :ivar image: The container registry image of this build result. + :vartype image: str + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "build_stages": {"readonly": True}, + "image": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "error": {"key": "error", "type": "Error"}, + "build_pod_name": {"key": "buildPodName", "type": "str"}, + "build_stages": {"key": "buildStages", "type": "[BuildStageProperties]"}, + "image": {"key": "image", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + error: Optional["_models.Error"] = None, + build_pod_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of this build result. + :paramtype name: str + :keyword error: Error when build is failed. + :paramtype error: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Error + :keyword build_pod_name: The build pod name which can be used to get the build log streaming. + :paramtype build_pod_name: str + """ + super().__init__(**kwargs) + self.name = name + self.provisioning_state = None + self.error = error + self.build_pod_name = build_pod_name + self.build_stages = None + self.image = None + + +class UserSourceInfo(_serialization.Model): + """Source information for a deployment or a job. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo + + All required parameters must be populated in order to send to server. + + :ivar type: Type of the source uploaded. Required. + :vartype type: str + :ivar version: Version of the source. + :vartype version: str + """ + + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "version": {"key": "version", "type": "str"}, + } + + _subtype_map = { + "type": { + "BuildResult": "BuildResultUserSourceInfo", + "Container": "CustomContainerUserSourceInfo", + "UploadedUserSourceInfo": "UploadedUserSourceInfo", + } + } + + def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword version: Version of the source. + :paramtype version: str + """ + super().__init__(**kwargs) + self.type: Optional[str] = None + self.version = version + + +class BuildResultUserSourceInfo(UserSourceInfo): + """Reference to a build result. + + All required parameters must be populated in order to send to server. + + :ivar type: Type of the source uploaded. Required. + :vartype type: str + :ivar version: Version of the source. + :vartype version: str + :ivar build_result_id: Resource id of an existing succeeded build result under the same Spring + instance. + :vartype build_result_id: str + """ + + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "build_result_id": {"key": "buildResultId", "type": "str"}, + } + + def __init__(self, *, version: Optional[str] = None, build_result_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword version: Version of the source. + :paramtype version: str + :keyword build_result_id: Resource id of an existing succeeded build result under the same + Spring instance. + :paramtype build_result_id: str + """ + super().__init__(version=version, **kwargs) + self.type: str = "BuildResult" + self.build_result_id = build_result_id + + +class BuildService(ProxyResource): + """Build service resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of the build resource. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "BuildServiceProperties"}, + } + + def __init__(self, *, properties: Optional["_models.BuildServiceProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of the build resource. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class BuildServiceAgentPoolProperties(_serialization.Model): + """Build service agent pool properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: Provisioning state of the build service agent pool. + :vartype provisioning_state: str + :ivar pool_size: build service agent pool size properties. + :vartype pool_size: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolSizeProperties + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "pool_size": {"key": "poolSize", "type": "BuildServiceAgentPoolSizeProperties"}, + } + + def __init__( + self, *, pool_size: Optional["_models.BuildServiceAgentPoolSizeProperties"] = None, **kwargs: Any + ) -> None: + """ + :keyword pool_size: build service agent pool size properties. + :paramtype pool_size: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolSizeProperties + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.pool_size = pool_size + + +class BuildServiceAgentPoolResource(ProxyResource): + """The build service agent pool resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: build service agent pool properties. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "BuildServiceAgentPoolProperties"}, + } + + def __init__( + self, *, properties: Optional["_models.BuildServiceAgentPoolProperties"] = None, **kwargs: Any + ) -> None: + """ + :keyword properties: build service agent pool properties. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class BuildServiceAgentPoolResourceCollection(_serialization.Model): + """Object that includes an array of build service agent pool resources and a possible link for + next set. + + :ivar value: Collection of build service agent pool resource. + :vartype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[BuildServiceAgentPoolResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.BuildServiceAgentPoolResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of build service agent pool resource. + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BuildServiceAgentPoolSizeProperties(_serialization.Model): + """Build service agent pool size properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of build service agent pool size. + :vartype name: str + :ivar cpu: The cpu property of build service agent pool size. + :vartype cpu: str + :ivar memory: The memory property of build service agent pool size. + :vartype memory: str + """ + + _validation = { + "cpu": {"readonly": True}, + "memory": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: The name of build service agent pool size. + :paramtype name: str + """ + super().__init__(**kwargs) + self.name = name + self.cpu = None + self.memory = None + + +class BuildServiceCollection(_serialization.Model): + """Object that includes an array of Build service resources and a possible link for next set. + + :ivar value: Collection of Build service resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[BuildService]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.BuildService"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Build service resources. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BuildServiceProperties(_serialization.Model): + """Build service resource properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar container_registry: The resource id of the container registry used in this build service. + :vartype container_registry: str + :ivar k_pack_version: The installed KPack version in this build service. + :vartype k_pack_version: str + :ivar provisioning_state: Provisioning state of the KPack build service. Known values are: + "Creating", "Updating", "Succeeded", "Failed", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceProvisioningState + :ivar resource_requests: The runtime resource configuration of this build service. + :vartype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServicePropertiesResourceRequests + """ + + _validation = { + "k_pack_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "container_registry": {"key": "containerRegistry", "type": "str"}, + "k_pack_version": {"key": "kPackVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resource_requests": {"key": "resourceRequests", "type": "BuildServicePropertiesResourceRequests"}, + } + + def __init__( + self, + *, + container_registry: Optional[str] = None, + resource_requests: Optional["_models.BuildServicePropertiesResourceRequests"] = None, + **kwargs: Any + ) -> None: + """ + :keyword container_registry: The resource id of the container registry used in this build + service. + :paramtype container_registry: str + :keyword resource_requests: The runtime resource configuration of this build service. + :paramtype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServicePropertiesResourceRequests + """ + super().__init__(**kwargs) + self.container_registry = container_registry + self.k_pack_version = None + self.provisioning_state = None + self.resource_requests = resource_requests + + +class BuildServicePropertiesResourceRequests(_serialization.Model): + """The runtime resource configuration of this build service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cpu: vCPU allocated to the entire build service node pool. + :vartype cpu: str + :ivar memory: Memory allocated to the entire build service node pool. + :vartype memory: str + """ + + _validation = { + "cpu": {"readonly": True}, + "memory": {"readonly": True}, + } + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.cpu = None + self.memory = None + + +class BuildStageProperties(_serialization.Model): + """The build stage (init-container and container) resources in build pod. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of this build stage resource. + :vartype name: str + :ivar status: The provisioning state of this build stage resource. Known values are: + "NotStarted", "Running", "Succeeded", and "Failed". + :vartype status: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.KPackBuildStageProvisioningState + :ivar exit_code: The exit code of this build init container. + :vartype exit_code: str + :ivar reason: The reason of this build init container. + :vartype reason: str + """ + + _validation = { + "name": {"readonly": True}, + "status": {"readonly": True}, + "exit_code": {"readonly": True}, + "reason": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "exit_code": {"key": "exitCode", "type": "str"}, + "reason": {"key": "reason", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.status = None + self.exit_code = None + self.reason = None + + +class CertificateProperties(_serialization.Model): + """Certificate resource payload. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ContentCertificateProperties, KeyVaultCertificateProperties + + 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 server. + + :ivar type: The type of the certificate source. Required. + :vartype type: str + :ivar thumbprint: The thumbprint of certificate. + :vartype thumbprint: str + :ivar issuer: The issuer of certificate. + :vartype issuer: str + :ivar issued_date: The issue date of certificate. + :vartype issued_date: str + :ivar expiration_date: The expiration date of certificate. + :vartype expiration_date: str + :ivar activate_date: The activate date of certificate. + :vartype activate_date: str + :ivar subject_name: The subject name of certificate. + :vartype subject_name: str + :ivar dns_names: The domain list of certificate. + :vartype dns_names: list[str] + :ivar provisioning_state: Provisioning state of the Certificate. Known values are: "Creating", + "Updating", "Succeeded", "Failed", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResourceProvisioningState + """ + + _validation = { + "type": {"required": True}, + "thumbprint": {"readonly": True}, + "issuer": {"readonly": True}, + "issued_date": {"readonly": True}, + "expiration_date": {"readonly": True}, + "activate_date": {"readonly": True}, + "subject_name": {"readonly": True}, + "dns_names": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, + "issuer": {"key": "issuer", "type": "str"}, + "issued_date": {"key": "issuedDate", "type": "str"}, + "expiration_date": {"key": "expirationDate", "type": "str"}, + "activate_date": {"key": "activateDate", "type": "str"}, + "subject_name": {"key": "subjectName", "type": "str"}, + "dns_names": {"key": "dnsNames", "type": "[str]"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + } + + _subtype_map = { + "type": { + "ContentCertificate": "ContentCertificateProperties", + "KeyVaultCertificate": "KeyVaultCertificateProperties", + } + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.type: Optional[str] = None + self.thumbprint = None + self.issuer = None + self.issued_date = None + self.expiration_date = None + self.activate_date = None + self.subject_name = None + self.dns_names = None + self.provisioning_state = None + + +class CertificateReference(_serialization.Model): + """A reference to the certificate. + + All required parameters must be populated in order to send to server. + + :ivar resource_id: Resource Id of the certificate. Required. + :vartype resource_id: str + """ + + _validation = { + "resource_id": {"required": True}, + } + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + } + + def __init__(self, *, resource_id: str, **kwargs: Any) -> None: + """ + :keyword resource_id: Resource Id of the certificate. Required. + :paramtype resource_id: str + """ + super().__init__(**kwargs) + self.resource_id = resource_id + + +class CertificateResource(ProxyResource): + """Certificate resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of the certificate resource payload. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CertificateProperties"}, + } + + def __init__(self, *, properties: Optional["_models.CertificateProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of the certificate resource payload. + :paramtype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class CertificateResourceCollection(_serialization.Model): + """Collection compose of certificate resources list and a possible link for next page. + + :ivar value: The certificate resources list. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource] + :ivar next_link: The link to next page of certificate list. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[CertificateResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.CertificateResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The certificate resources list. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource] + :keyword next_link: The link to next page of certificate list. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class CloudErrorBody(_serialization.Model): + """An error response from the service. + + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user + interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in + error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.CloudErrorBody] + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[CloudErrorBody]"}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["_models.CloudErrorBody"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.CloudErrorBody] + """ + super().__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ClusterResourceProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Service properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: Provisioning state of the Service. Known values are: "Creating", + "Updating", "Starting", "Stopping", "Deleting", "Deleted", "Succeeded", "Failed", "Moving", + "Moved", and "MoveFailed". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ProvisioningState + :ivar network_profile: Network profile of the Service. + :vartype network_profile: ~azure.mgmt.appplatform.v2024_05_01_preview.models.NetworkProfile + :ivar vnet_addons: Additional Service settings in vnet injection instance. + :vartype vnet_addons: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceVNetAddons + :ivar maintenance_schedule_configuration: Additional Service settings for planned maintenance. + :vartype maintenance_schedule_configuration: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MaintenanceScheduleConfiguration + :ivar version: Version of the Service. + :vartype version: int + :ivar service_id: ServiceInstanceEntity Id which uniquely identifies a created resource. + :vartype service_id: str + :ivar managed_environment_id: The resource Id of the Managed Environment that the Spring Apps + instance builds on. + :vartype managed_environment_id: str + :ivar infra_resource_group: The name of the resource group that contains the infrastructure + resources. + :vartype infra_resource_group: str + :ivar power_state: Power state of the Service. Known values are: "Running" and "Stopped". + :vartype power_state: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.PowerState + :ivar zone_redundant: + :vartype zone_redundant: bool + :ivar fqdn: Fully qualified dns name of the service instance. + :vartype fqdn: str + :ivar marketplace_resource: Purchasing 3rd party product of the Service resource. + :vartype marketplace_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MarketplaceResource + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "version": {"readonly": True}, + "service_id": {"readonly": True}, + "power_state": {"readonly": True}, + "fqdn": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "network_profile": {"key": "networkProfile", "type": "NetworkProfile"}, + "vnet_addons": {"key": "vnetAddons", "type": "ServiceVNetAddons"}, + "maintenance_schedule_configuration": { + "key": "maintenanceScheduleConfiguration", + "type": "MaintenanceScheduleConfiguration", + }, + "version": {"key": "version", "type": "int"}, + "service_id": {"key": "serviceId", "type": "str"}, + "managed_environment_id": {"key": "managedEnvironmentId", "type": "str"}, + "infra_resource_group": {"key": "infraResourceGroup", "type": "str"}, + "power_state": {"key": "powerState", "type": "str"}, + "zone_redundant": {"key": "zoneRedundant", "type": "bool"}, + "fqdn": {"key": "fqdn", "type": "str"}, + "marketplace_resource": {"key": "marketplaceResource", "type": "MarketplaceResource"}, + } + + def __init__( + self, + *, + network_profile: Optional["_models.NetworkProfile"] = None, + vnet_addons: Optional["_models.ServiceVNetAddons"] = None, + maintenance_schedule_configuration: Optional["_models.MaintenanceScheduleConfiguration"] = None, + managed_environment_id: Optional[str] = None, + infra_resource_group: Optional[str] = None, + zone_redundant: bool = False, + marketplace_resource: Optional["_models.MarketplaceResource"] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_profile: Network profile of the Service. + :paramtype network_profile: ~azure.mgmt.appplatform.v2024_05_01_preview.models.NetworkProfile + :keyword vnet_addons: Additional Service settings in vnet injection instance. + :paramtype vnet_addons: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceVNetAddons + :keyword maintenance_schedule_configuration: Additional Service settings for planned + maintenance. + :paramtype maintenance_schedule_configuration: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MaintenanceScheduleConfiguration + :keyword managed_environment_id: The resource Id of the Managed Environment that the Spring + Apps instance builds on. + :paramtype managed_environment_id: str + :keyword infra_resource_group: The name of the resource group that contains the infrastructure + resources. + :paramtype infra_resource_group: str + :keyword zone_redundant: + :paramtype zone_redundant: bool + :keyword marketplace_resource: Purchasing 3rd party product of the Service resource. + :paramtype marketplace_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MarketplaceResource + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.network_profile = network_profile + self.vnet_addons = vnet_addons + self.maintenance_schedule_configuration = maintenance_schedule_configuration + self.version = None + self.service_id = None + self.managed_environment_id = managed_environment_id + self.infra_resource_group = infra_resource_group + self.power_state = None + self.zone_redundant = zone_redundant + self.fqdn = None + self.marketplace_resource = marketplace_resource + + +class ConfigServerGitProperty(_serialization.Model): + """Property of git. + + All required parameters must be populated in order to send to server. + + :ivar repositories: Repositories of git. + :vartype repositories: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.GitPatternRepository] + :ivar uri: URI of the repository. Required. + :vartype uri: str + :ivar label: Label of the repository. + :vartype label: str + :ivar search_paths: Searching path of the repository. + :vartype search_paths: list[str] + :ivar username: Username of git repository basic auth. + :vartype username: str + :ivar password: Password of git repository basic auth. + :vartype password: str + :ivar host_key: Public sshKey of git repository. + :vartype host_key: str + :ivar host_key_algorithm: SshKey algorithm of git repository. + :vartype host_key_algorithm: str + :ivar private_key: Private sshKey algorithm of git repository. + :vartype private_key: str + :ivar strict_host_key_checking: Strict host key checking or not. + :vartype strict_host_key_checking: bool + """ + + _validation = { + "uri": {"required": True}, + } + + _attribute_map = { + "repositories": {"key": "repositories", "type": "[GitPatternRepository]"}, + "uri": {"key": "uri", "type": "str"}, + "label": {"key": "label", "type": "str"}, + "search_paths": {"key": "searchPaths", "type": "[str]"}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "host_key": {"key": "hostKey", "type": "str"}, + "host_key_algorithm": {"key": "hostKeyAlgorithm", "type": "str"}, + "private_key": {"key": "privateKey", "type": "str"}, + "strict_host_key_checking": {"key": "strictHostKeyChecking", "type": "bool"}, + } + + def __init__( + self, + *, + uri: str, + repositories: Optional[List["_models.GitPatternRepository"]] = None, + label: Optional[str] = None, + search_paths: Optional[List[str]] = None, + username: Optional[str] = None, + password: Optional[str] = None, + host_key: Optional[str] = None, + host_key_algorithm: Optional[str] = None, + private_key: Optional[str] = None, + strict_host_key_checking: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword repositories: Repositories of git. + :paramtype repositories: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.GitPatternRepository] + :keyword uri: URI of the repository. Required. + :paramtype uri: str + :keyword label: Label of the repository. + :paramtype label: str + :keyword search_paths: Searching path of the repository. + :paramtype search_paths: list[str] + :keyword username: Username of git repository basic auth. + :paramtype username: str + :keyword password: Password of git repository basic auth. + :paramtype password: str + :keyword host_key: Public sshKey of git repository. + :paramtype host_key: str + :keyword host_key_algorithm: SshKey algorithm of git repository. + :paramtype host_key_algorithm: str + :keyword private_key: Private sshKey algorithm of git repository. + :paramtype private_key: str + :keyword strict_host_key_checking: Strict host key checking or not. + :paramtype strict_host_key_checking: bool + """ + super().__init__(**kwargs) + self.repositories = repositories + self.uri = uri + self.label = label + self.search_paths = search_paths + self.username = username + self.password = password + self.host_key = host_key + self.host_key_algorithm = host_key_algorithm + self.private_key = private_key + self.strict_host_key_checking = strict_host_key_checking + + +class ConfigServerInstance(_serialization.Model): + """Collection of instances belong to the Config Server, only available in Enterprise Plan. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the Config Server instance. + :vartype name: str + :ivar status: Status of the Config Server instance. + :vartype status: str + """ + + _validation = { + "name": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.status = None + + +class ConfigServerProperties(_serialization.Model): + """Config server git properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: State of the config server. Known values are: "NotAvailable", + "Creating", "Deleted", "Failed", "Succeeded", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerState + :ivar resource_requests: The requested resource quantity for required CPU and Memory, only + available in Enterprise Plan. + :vartype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResourceRequests + :ivar instances: Collection of instances belong to Config Server, only available in Enterprise + Plan. + :vartype instances: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerInstance] + :ivar error: Error when apply config server settings. + :vartype error: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Error + :ivar enabled_state: Enabled state of the config server. This is only used in Consumption tier. + Known values are: "Enabled" and "Disabled". + :vartype enabled_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerEnabledState + :ivar config_server: Settings of config server. + :vartype config_server: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerSettings + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "resource_requests": {"readonly": True}, + "instances": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resource_requests": {"key": "resourceRequests", "type": "ConfigServerResourceRequests"}, + "instances": {"key": "instances", "type": "[ConfigServerInstance]"}, + "error": {"key": "error", "type": "Error"}, + "enabled_state": {"key": "enabledState", "type": "str"}, + "config_server": {"key": "configServer", "type": "ConfigServerSettings"}, + } + + def __init__( + self, + *, + error: Optional["_models.Error"] = None, + enabled_state: Optional[Union[str, "_models.ConfigServerEnabledState"]] = None, + config_server: Optional["_models.ConfigServerSettings"] = None, + **kwargs: Any + ) -> None: + """ + :keyword error: Error when apply config server settings. + :paramtype error: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Error + :keyword enabled_state: Enabled state of the config server. This is only used in Consumption + tier. Known values are: "Enabled" and "Disabled". + :paramtype enabled_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerEnabledState + :keyword config_server: Settings of config server. + :paramtype config_server: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerSettings + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.resource_requests = None + self.instances = None + self.error = error + self.enabled_state = enabled_state + self.config_server = config_server + + +class ConfigServerResource(ProxyResource): + """Config Server resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of the Config Server resource. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ConfigServerProperties"}, + } + + def __init__(self, *, properties: Optional["_models.ConfigServerProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of the Config Server resource. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class ConfigServerResourceCollection(_serialization.Model): + """Object that includes an array of config server resources and a possible link for next set. + + :ivar value: Collection of config server resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ConfigServerResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ConfigServerResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of config server resources. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ConfigServerResourceRequests(_serialization.Model): + """Resource request payload of Config Server, only available in Enterprise Plan. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cpu: CPU allocated to each Config Server instance. + :vartype cpu: str + :ivar memory: Memory allocated to each Config Server instance. + :vartype memory: str + :ivar instance_count: Instance count of the Config Server. + :vartype instance_count: int + """ + + _validation = { + "cpu": {"readonly": True}, + "memory": {"readonly": True}, + "instance_count": {"readonly": True}, + } + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.cpu = None + self.memory = None + self.instance_count = None + + +class ConfigServerSettings(_serialization.Model): + """The settings of config server. + + :ivar git_property: Property of git environment. + :vartype git_property: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerGitProperty + """ + + _attribute_map = { + "git_property": {"key": "gitProperty", "type": "ConfigServerGitProperty"}, + } + + def __init__(self, *, git_property: Optional["_models.ConfigServerGitProperty"] = None, **kwargs: Any) -> None: + """ + :keyword git_property: Property of git environment. + :paramtype git_property: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerGitProperty + """ + super().__init__(**kwargs) + self.git_property = git_property + + +class ConfigServerSettingsErrorRecord(_serialization.Model): + """Error record of the config server settings. + + :ivar name: The name of the config server settings error record. + :vartype name: str + :ivar uri: The uri of the config server settings error record. + :vartype uri: str + :ivar messages: The detail error messages of the record. + :vartype messages: list[str] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "messages": {"key": "messages", "type": "[str]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + uri: Optional[str] = None, + messages: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the config server settings error record. + :paramtype name: str + :keyword uri: The uri of the config server settings error record. + :paramtype uri: str + :keyword messages: The detail error messages of the record. + :paramtype messages: list[str] + """ + super().__init__(**kwargs) + self.name = name + self.uri = uri + self.messages = messages + + +class ConfigServerSettingsValidateResult(_serialization.Model): + """Validation result for config server settings. + + :ivar is_valid: Indicate if the config server settings are valid. + :vartype is_valid: bool + :ivar details: The detail validation results. + :vartype details: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerSettingsErrorRecord] + """ + + _attribute_map = { + "is_valid": {"key": "isValid", "type": "bool"}, + "details": {"key": "details", "type": "[ConfigServerSettingsErrorRecord]"}, + } + + def __init__( + self, + *, + is_valid: Optional[bool] = None, + details: Optional[List["_models.ConfigServerSettingsErrorRecord"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword is_valid: Indicate if the config server settings are valid. + :paramtype is_valid: bool + :keyword details: The detail validation results. + :paramtype details: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerSettingsErrorRecord] + """ + super().__init__(**kwargs) + self.is_valid = is_valid + self.details = details + + +class ConfigurationServiceGitProperty(_serialization.Model): + """Property of git environment. + + :ivar repositories: Repositories of Application Configuration Service git property. + :vartype repositories: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceGitRepository] + """ + + _attribute_map = { + "repositories": {"key": "repositories", "type": "[ConfigurationServiceGitRepository]"}, + } + + def __init__( + self, *, repositories: Optional[List["_models.ConfigurationServiceGitRepository"]] = None, **kwargs: Any + ) -> None: + """ + :keyword repositories: Repositories of Application Configuration Service git property. + :paramtype repositories: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceGitRepository] + """ + super().__init__(**kwargs) + self.repositories = repositories + + +class ConfigurationServiceGitPropertyValidateResult(_serialization.Model): # pylint: disable=name-too-long + """Validation result for configuration service settings. + + :ivar is_valid: Indicate if the configuration service settings are valid. + :vartype is_valid: bool + :ivar git_repos_validation_result: The detail validation results. + :vartype git_repos_validation_result: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ValidationMessages] + """ + + _attribute_map = { + "is_valid": {"key": "isValid", "type": "bool"}, + "git_repos_validation_result": {"key": "gitReposValidationResult", "type": "[ValidationMessages]"}, + } + + def __init__( + self, + *, + is_valid: Optional[bool] = None, + git_repos_validation_result: Optional[List["_models.ValidationMessages"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword is_valid: Indicate if the configuration service settings are valid. + :paramtype is_valid: bool + :keyword git_repos_validation_result: The detail validation results. + :paramtype git_repos_validation_result: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ValidationMessages] + """ + super().__init__(**kwargs) + self.is_valid = is_valid + self.git_repos_validation_result = git_repos_validation_result + + +class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Git repository property payload for Application Configuration Service. + + All required parameters must be populated in order to send to server. + + :ivar name: Name of the repository. Required. + :vartype name: str + :ivar patterns: Collection of patterns of the repository. Required. + :vartype patterns: list[str] + :ivar uri: URI of the repository. Required. + :vartype uri: str + :ivar label: Label of the repository. Required. + :vartype label: str + :ivar search_paths: Searching path of the repository. + :vartype search_paths: list[str] + :ivar username: Username of git repository basic auth. + :vartype username: str + :ivar password: Password of git repository basic auth. + :vartype password: str + :ivar host_key: Public sshKey of git repository. + :vartype host_key: str + :ivar host_key_algorithm: SshKey algorithm of git repository. + :vartype host_key_algorithm: str + :ivar private_key: Private sshKey algorithm of git repository. + :vartype private_key: str + :ivar strict_host_key_checking: Strict host key checking or not. + :vartype strict_host_key_checking: bool + :ivar git_implementation: Git libraries used to support various repository providers. Known + values are: "go-git" and "libgit2". + :vartype git_implementation: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GitImplementation + :ivar ca_cert_resource_id: Resource Id of CA certificate for https URL of Git repository. + :vartype ca_cert_resource_id: str + """ + + _validation = { + "name": {"required": True}, + "patterns": {"required": True}, + "uri": {"required": True}, + "label": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "patterns": {"key": "patterns", "type": "[str]"}, + "uri": {"key": "uri", "type": "str"}, + "label": {"key": "label", "type": "str"}, + "search_paths": {"key": "searchPaths", "type": "[str]"}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "host_key": {"key": "hostKey", "type": "str"}, + "host_key_algorithm": {"key": "hostKeyAlgorithm", "type": "str"}, + "private_key": {"key": "privateKey", "type": "str"}, + "strict_host_key_checking": {"key": "strictHostKeyChecking", "type": "bool"}, + "git_implementation": {"key": "gitImplementation", "type": "str"}, + "ca_cert_resource_id": {"key": "caCertResourceId", "type": "str"}, + } + + def __init__( + self, + *, + name: str, + patterns: List[str], + uri: str, + label: str, + search_paths: Optional[List[str]] = None, + username: Optional[str] = None, + password: Optional[str] = None, + host_key: Optional[str] = None, + host_key_algorithm: Optional[str] = None, + private_key: Optional[str] = None, + strict_host_key_checking: Optional[bool] = None, + git_implementation: Optional[Union[str, "_models.GitImplementation"]] = None, + ca_cert_resource_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the repository. Required. + :paramtype name: str + :keyword patterns: Collection of patterns of the repository. Required. + :paramtype patterns: list[str] + :keyword uri: URI of the repository. Required. + :paramtype uri: str + :keyword label: Label of the repository. Required. + :paramtype label: str + :keyword search_paths: Searching path of the repository. + :paramtype search_paths: list[str] + :keyword username: Username of git repository basic auth. + :paramtype username: str + :keyword password: Password of git repository basic auth. + :paramtype password: str + :keyword host_key: Public sshKey of git repository. + :paramtype host_key: str + :keyword host_key_algorithm: SshKey algorithm of git repository. + :paramtype host_key_algorithm: str + :keyword private_key: Private sshKey algorithm of git repository. + :paramtype private_key: str + :keyword strict_host_key_checking: Strict host key checking or not. + :paramtype strict_host_key_checking: bool + :keyword git_implementation: Git libraries used to support various repository providers. Known + values are: "go-git" and "libgit2". + :paramtype git_implementation: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GitImplementation + :keyword ca_cert_resource_id: Resource Id of CA certificate for https URL of Git repository. + :paramtype ca_cert_resource_id: str + """ + super().__init__(**kwargs) + self.name = name + self.patterns = patterns + self.uri = uri + self.label = label + self.search_paths = search_paths + self.username = username + self.password = password + self.host_key = host_key + self.host_key_algorithm = host_key_algorithm + self.private_key = private_key + self.strict_host_key_checking = strict_host_key_checking + self.git_implementation = git_implementation + self.ca_cert_resource_id = ca_cert_resource_id + + +class ConfigurationServiceInstance(_serialization.Model): + """Collection of instances belong to the Application Configuration Service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the Application Configuration Service instance. + :vartype name: str + :ivar status: Status of the Application Configuration Service instance. + :vartype status: str + """ + + _validation = { + "name": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.status = None + + +class ConfigurationServiceProperties(_serialization.Model): + """Application Configuration Service properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: State of the Application Configuration Service. Known values are: + "Creating", "Updating", "Succeeded", "Failed", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceProvisioningState + :ivar generation: The generation of the Application Configuration Service. Known values are: + "Gen1" and "Gen2". + :vartype generation: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceGeneration + :ivar resource_requests: The requested resource quantity for required CPU and Memory. + :vartype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResourceRequests + :ivar instances: Collection of instances belong to Application Configuration Service. + :vartype instances: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceInstance] + :ivar settings: The settings of Application Configuration Service. + :vartype settings: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettings + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "resource_requests": {"readonly": True}, + "instances": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "generation": {"key": "generation", "type": "str"}, + "resource_requests": {"key": "resourceRequests", "type": "ConfigurationServiceResourceRequests"}, + "instances": {"key": "instances", "type": "[ConfigurationServiceInstance]"}, + "settings": {"key": "settings", "type": "ConfigurationServiceSettings"}, + } + + def __init__( + self, + *, + generation: Union[str, "_models.ConfigurationServiceGeneration"] = "Gen1", + settings: Optional["_models.ConfigurationServiceSettings"] = None, + **kwargs: Any + ) -> None: + """ + :keyword generation: The generation of the Application Configuration Service. Known values are: + "Gen1" and "Gen2". + :paramtype generation: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceGeneration + :keyword settings: The settings of Application Configuration Service. + :paramtype settings: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettings + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.generation = generation + self.resource_requests = None + self.instances = None + self.settings = settings + + +class ConfigurationServiceResource(ProxyResource): + """Application Configuration Service resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Application Configuration Service properties payload. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ConfigurationServiceProperties"}, + } + + def __init__(self, *, properties: Optional["_models.ConfigurationServiceProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Application Configuration Service properties payload. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class ConfigurationServiceResourceCollection(_serialization.Model): + """Object that includes an array of configuration service resources and a possible link for next + set. + + :ivar value: Collection of configuration service resources. + :vartype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ConfigurationServiceResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ConfigurationServiceResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of configuration service resources. + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ConfigurationServiceResourceRequests(_serialization.Model): + """Resource request payload of Application Configuration Service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cpu: CPU allocated to each Application Configuration Service instance. + :vartype cpu: str + :ivar memory: Memory allocated to each Application Configuration Service instance. + :vartype memory: str + :ivar instance_count: Instance count of the Application Configuration Service. + :vartype instance_count: int + """ + + _validation = { + "cpu": {"readonly": True}, + "memory": {"readonly": True}, + "instance_count": {"readonly": True}, + } + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.cpu = None + self.memory = None + self.instance_count = None + + +class ConfigurationServiceSettings(_serialization.Model): + """The settings of Application Configuration Service. + + :ivar git_property: Property of git environment. + :vartype git_property: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceGitProperty + :ivar refresh_interval_in_seconds: How often (in seconds) to check repository updates. Minimum + value is 0. + :vartype refresh_interval_in_seconds: int + """ + + _attribute_map = { + "git_property": {"key": "gitProperty", "type": "ConfigurationServiceGitProperty"}, + "refresh_interval_in_seconds": {"key": "refreshIntervalInSeconds", "type": "int"}, + } + + def __init__( + self, + *, + git_property: Optional["_models.ConfigurationServiceGitProperty"] = None, + refresh_interval_in_seconds: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword git_property: Property of git environment. + :paramtype git_property: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceGitProperty + :keyword refresh_interval_in_seconds: How often (in seconds) to check repository updates. + Minimum value is 0. + :paramtype refresh_interval_in_seconds: int + """ + super().__init__(**kwargs) + self.git_property = git_property + self.refresh_interval_in_seconds = refresh_interval_in_seconds + + +class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long + """Validation result for configuration service settings. + + :ivar git_property_validation_result: Validation result for configuration service settings. + :vartype git_property_validation_result: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceGitPropertyValidateResult + """ + + _attribute_map = { + "git_property_validation_result": { + "key": "gitPropertyValidationResult", + "type": "ConfigurationServiceGitPropertyValidateResult", + }, + } + + def __init__( + self, + *, + git_property_validation_result: Optional["_models.ConfigurationServiceGitPropertyValidateResult"] = None, + **kwargs: Any + ) -> None: + """ + :keyword git_property_validation_result: Validation result for configuration service settings. + :paramtype git_property_validation_result: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceGitPropertyValidateResult + """ + super().__init__(**kwargs) + self.git_property_validation_result = git_property_validation_result + + +class ContainerProbeSettings(_serialization.Model): + """Container liveness and readiness probe settings. + + :ivar disable_probe: Indicates whether disable the liveness and readiness probe. + :vartype disable_probe: bool + """ + + _attribute_map = { + "disable_probe": {"key": "disableProbe", "type": "bool"}, + } + + def __init__(self, *, disable_probe: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword disable_probe: Indicates whether disable the liveness and readiness probe. + :paramtype disable_probe: bool + """ + super().__init__(**kwargs) + self.disable_probe = disable_probe + + +class ContainerRegistryCredentials(_serialization.Model): + """The credential for the container registry resource. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ContainerRegistryBasicCredentials + + All required parameters must be populated in order to send to server. + + :ivar type: The credential type of the container registry credentials. Required. + :vartype type: str + """ + + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + } + + _subtype_map = {"type": {"BasicAuth": "ContainerRegistryBasicCredentials"}} + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.type: Optional[str] = None + + +class ContainerRegistryBasicCredentials(ContainerRegistryCredentials): + """The basic authentication properties for the container registry resource. + + All required parameters must be populated in order to send to server. + + :ivar type: The credential type of the container registry credentials. Required. + :vartype type: str + :ivar server: The login server of the Container Registry. Required. + :vartype server: str + :ivar username: The username of the Container Registry. Required. + :vartype username: str + :ivar password: The password of the Container Registry. Required. + :vartype password: str + """ + + _validation = { + "type": {"required": True}, + "server": {"required": True}, + "username": {"required": True}, + "password": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "server": {"key": "server", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + } + + def __init__(self, *, server: str, username: str, password: str, **kwargs: Any) -> None: + """ + :keyword server: The login server of the Container Registry. Required. + :paramtype server: str + :keyword username: The username of the Container Registry. Required. + :paramtype username: str + :keyword password: The password of the Container Registry. Required. + :paramtype password: str + """ + super().__init__(**kwargs) + self.type: str = "BasicAuth" + self.server = server + self.username = username + self.password = password + + +class ContainerRegistryProperties(_serialization.Model): + """Container registry resource payload. + + 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 server. + + :ivar credentials: The credentials of the container registry resource. Required. + :vartype credentials: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryCredentials + :ivar provisioning_state: State of the Container Registry. Known values are: "Creating", + "Updating", "Succeeded", "Failed", "Deleting", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryProvisioningState + """ + + _validation = { + "credentials": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "credentials": {"key": "credentials", "type": "ContainerRegistryCredentials"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + } + + def __init__(self, *, credentials: "_models.ContainerRegistryCredentials", **kwargs: Any) -> None: + """ + :keyword credentials: The credentials of the container registry resource. Required. + :paramtype credentials: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryCredentials + """ + super().__init__(**kwargs) + self.credentials = credentials + self.provisioning_state = None + + +class ContainerRegistryResource(ProxyResource): + """Container registry resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of the container registry resource payload. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ContainerRegistryProperties"}, + } + + def __init__(self, *, properties: Optional["_models.ContainerRegistryProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of the container registry resource payload. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class ContainerRegistryResourceCollection(_serialization.Model): + """Collection compose of container registry resources list and a possible link for next page. + + :ivar value: The container registry resources list. + :vartype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource] + :ivar next_link: The link to next page of storage list. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ContainerRegistryResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ContainerRegistryResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The container registry resources list. + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource] + :keyword next_link: The link to next page of storage list. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ContainerRegistryValidateResult(_serialization.Model): + """Validation result for container registry properties. + + :ivar is_valid: Indicate if the container registry properties are valid. + :vartype is_valid: bool + :ivar message: Detailed validation messages. + :vartype message: str + """ + + _attribute_map = { + "is_valid": {"key": "isValid", "type": "bool"}, + "message": {"key": "message", "type": "str"}, + } + + def __init__(self, *, is_valid: Optional[bool] = None, message: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword is_valid: Indicate if the container registry properties are valid. + :paramtype is_valid: bool + :keyword message: Detailed validation messages. + :paramtype message: str + """ + super().__init__(**kwargs) + self.is_valid = is_valid + self.message = message + + +class ContentCertificateProperties(CertificateProperties): + """Properties of certificate imported from key 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 server. + + :ivar type: The type of the certificate source. Required. + :vartype type: str + :ivar thumbprint: The thumbprint of certificate. + :vartype thumbprint: str + :ivar issuer: The issuer of certificate. + :vartype issuer: str + :ivar issued_date: The issue date of certificate. + :vartype issued_date: str + :ivar expiration_date: The expiration date of certificate. + :vartype expiration_date: str + :ivar activate_date: The activate date of certificate. + :vartype activate_date: str + :ivar subject_name: The subject name of certificate. + :vartype subject_name: str + :ivar dns_names: The domain list of certificate. + :vartype dns_names: list[str] + :ivar provisioning_state: Provisioning state of the Certificate. Known values are: "Creating", + "Updating", "Succeeded", "Failed", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResourceProvisioningState + :ivar content: The content of uploaded certificate. + :vartype content: str + """ + + _validation = { + "type": {"required": True}, + "thumbprint": {"readonly": True}, + "issuer": {"readonly": True}, + "issued_date": {"readonly": True}, + "expiration_date": {"readonly": True}, + "activate_date": {"readonly": True}, + "subject_name": {"readonly": True}, + "dns_names": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, + "issuer": {"key": "issuer", "type": "str"}, + "issued_date": {"key": "issuedDate", "type": "str"}, + "expiration_date": {"key": "expirationDate", "type": "str"}, + "activate_date": {"key": "activateDate", "type": "str"}, + "subject_name": {"key": "subjectName", "type": "str"}, + "dns_names": {"key": "dnsNames", "type": "[str]"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "content": {"key": "content", "type": "str"}, + } + + def __init__(self, *, content: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword content: The content of uploaded certificate. + :paramtype content: str + """ + super().__init__(**kwargs) + self.type: str = "ContentCertificate" + self.content = content + + +class CustomContainer(_serialization.Model): + """Custom container payload. + + :ivar server: The name of the registry that contains the container image. + :vartype server: str + :ivar container_image: Container image of the custom container. This should be in the form of + :code:``::code:`` without the server name of the registry. + :vartype container_image: str + :ivar command: Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is + used if this is not provided. + :vartype command: list[str] + :ivar args: Arguments to the entrypoint. The docker image's CMD is used if this is not + provided. + :vartype args: list[str] + :ivar image_registry_credential: Credential of the image registry. + :vartype image_registry_credential: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ImageRegistryCredential + :ivar language_framework: Language framework of the container image uploaded. Supported values: + "springboot", "", null. + :vartype language_framework: str + """ + + _attribute_map = { + "server": {"key": "server", "type": "str"}, + "container_image": {"key": "containerImage", "type": "str"}, + "command": {"key": "command", "type": "[str]"}, + "args": {"key": "args", "type": "[str]"}, + "image_registry_credential": {"key": "imageRegistryCredential", "type": "ImageRegistryCredential"}, + "language_framework": {"key": "languageFramework", "type": "str"}, + } + + def __init__( + self, + *, + server: Optional[str] = None, + container_image: Optional[str] = None, + command: Optional[List[str]] = None, + args: Optional[List[str]] = None, + image_registry_credential: Optional["_models.ImageRegistryCredential"] = None, + language_framework: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword server: The name of the registry that contains the container image. + :paramtype server: str + :keyword container_image: Container image of the custom container. This should be in the form + of :code:``::code:`` without the server name of the registry. + :paramtype container_image: str + :keyword command: Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT + is used if this is not provided. + :paramtype command: list[str] + :keyword args: Arguments to the entrypoint. The docker image's CMD is used if this is not + provided. + :paramtype args: list[str] + :keyword image_registry_credential: Credential of the image registry. + :paramtype image_registry_credential: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ImageRegistryCredential + :keyword language_framework: Language framework of the container image uploaded. Supported + values: "springboot", "", null. + :paramtype language_framework: str + """ + super().__init__(**kwargs) + self.server = server + self.container_image = container_image + self.command = command + self.args = args + self.image_registry_credential = image_registry_credential + self.language_framework = language_framework + + +class CustomContainerUserSourceInfo(UserSourceInfo): + """Custom container user source info. + + All required parameters must be populated in order to send to server. + + :ivar type: Type of the source uploaded. Required. + :vartype type: str + :ivar version: Version of the source. + :vartype version: str + :ivar custom_container: Custom container payload. + :vartype custom_container: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomContainer + """ + + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "custom_container": {"key": "customContainer", "type": "CustomContainer"}, + } + + def __init__( + self, + *, + version: Optional[str] = None, + custom_container: Optional["_models.CustomContainer"] = None, + **kwargs: Any + ) -> None: + """ + :keyword version: Version of the source. + :paramtype version: str + :keyword custom_container: Custom container payload. + :paramtype custom_container: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomContainer + """ + super().__init__(version=version, **kwargs) + self.type: str = "Container" + self.custom_container = custom_container + + +class CustomDomainProperties(_serialization.Model): + """Custom domain of app resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar thumbprint: The thumbprint of bound certificate. + :vartype thumbprint: str + :ivar app_name: The app name of domain. + :vartype app_name: str + :ivar cert_name: The bound certificate name of domain. + :vartype cert_name: str + :ivar provisioning_state: Provisioning state of the Domain. Known values are: "Creating", + "Updating", "Succeeded", "Failed", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResourceProvisioningState + """ + + _validation = { + "app_name": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "thumbprint": {"key": "thumbprint", "type": "str"}, + "app_name": {"key": "appName", "type": "str"}, + "cert_name": {"key": "certName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + } + + def __init__(self, *, thumbprint: Optional[str] = None, cert_name: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword thumbprint: The thumbprint of bound certificate. + :paramtype thumbprint: str + :keyword cert_name: The bound certificate name of domain. + :paramtype cert_name: str + """ + super().__init__(**kwargs) + self.thumbprint = thumbprint + self.app_name = None + self.cert_name = cert_name + self.provisioning_state = None + + +class CustomDomainResource(ProxyResource): + """Custom domain resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of the custom domain resource. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CustomDomainProperties"}, + } + + def __init__(self, *, properties: Optional["_models.CustomDomainProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of the custom domain resource. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class CustomDomainResourceCollection(_serialization.Model): + """Collection compose of a custom domain resources list and a possible link for next page. + + :ivar value: The custom domain resources list. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :ivar next_link: The link to next page of custom domain list. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[CustomDomainResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.CustomDomainResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The custom domain resources list. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :keyword next_link: The link to next page of custom domain list. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class CustomDomainValidatePayload(_serialization.Model): + """Custom domain validate payload. + + All required parameters must be populated in order to send to server. + + :ivar name: Name to be validated. Required. + :vartype name: str + """ + + _validation = { + "name": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, *, name: str, **kwargs: Any) -> None: + """ + :keyword name: Name to be validated. Required. + :paramtype name: str + """ + super().__init__(**kwargs) + self.name = name + + +class CustomDomainValidateResult(_serialization.Model): + """Validation result for custom domain. + + :ivar is_valid: Indicates if domain name is valid. + :vartype is_valid: bool + :ivar message: Message of why domain name is invalid. + :vartype message: str + """ + + _attribute_map = { + "is_valid": {"key": "isValid", "type": "bool"}, + "message": {"key": "message", "type": "str"}, + } + + def __init__(self, *, is_valid: Optional[bool] = None, message: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword is_valid: Indicates if domain name is valid. + :paramtype is_valid: bool + :keyword message: Message of why domain name is invalid. + :paramtype message: str + """ + super().__init__(**kwargs) + self.is_valid = is_valid + self.message = message + + +class CustomizedAcceleratorProperties(_serialization.Model): + """Customized accelerator properties payload. + + 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 server. + + :ivar provisioning_state: State of the customized accelerator. Known values are: "Creating", + "Updating", "Succeeded", "Failed", "Deleting", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorProvisioningState + :ivar accelerator_type: Type of the customized accelerator. Known values are: "Accelerator" and + "Fragment". + :vartype accelerator_type: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorType + :ivar display_name: + :vartype display_name: str + :ivar description: + :vartype description: str + :ivar icon_url: + :vartype icon_url: str + :ivar accelerator_tags: + :vartype accelerator_tags: list[str] + :ivar imports: Imports references all imports that this accelerator/fragment depends upon. + :vartype imports: list[str] + :ivar git_repository: Required. + :vartype git_repository: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.AcceleratorGitRepository + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "imports": {"readonly": True}, + "git_repository": {"required": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "accelerator_type": {"key": "acceleratorType", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "icon_url": {"key": "iconUrl", "type": "str"}, + "accelerator_tags": {"key": "acceleratorTags", "type": "[str]"}, + "imports": {"key": "imports", "type": "[str]"}, + "git_repository": {"key": "gitRepository", "type": "AcceleratorGitRepository"}, + } + + def __init__( + self, + *, + git_repository: "_models.AcceleratorGitRepository", + accelerator_type: Optional[Union[str, "_models.CustomizedAcceleratorType"]] = None, + display_name: Optional[str] = None, + description: Optional[str] = None, + icon_url: Optional[str] = None, + accelerator_tags: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword accelerator_type: Type of the customized accelerator. Known values are: "Accelerator" + and "Fragment". + :paramtype accelerator_type: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorType + :keyword display_name: + :paramtype display_name: str + :keyword description: + :paramtype description: str + :keyword icon_url: + :paramtype icon_url: str + :keyword accelerator_tags: + :paramtype accelerator_tags: list[str] + :keyword git_repository: Required. + :paramtype git_repository: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.AcceleratorGitRepository + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.accelerator_type = accelerator_type + self.display_name = display_name + self.description = description + self.icon_url = icon_url + self.accelerator_tags = accelerator_tags + self.imports = None + self.git_repository = git_repository + + +class CustomizedAcceleratorResource(ProxyResource): + """Customized accelerator resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Customized accelerator properties payload. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorProperties + :ivar sku: Sku of the customized accelerator resource. + :vartype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CustomizedAcceleratorProperties"}, + "sku": {"key": "sku", "type": "Sku"}, + } + + def __init__( + self, + *, + properties: Optional["_models.CustomizedAcceleratorProperties"] = None, + sku: Optional["_models.Sku"] = None, + **kwargs: Any + ) -> None: + """ + :keyword properties: Customized accelerator properties payload. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorProperties + :keyword sku: Sku of the customized accelerator resource. + :paramtype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + super().__init__(**kwargs) + self.properties = properties + self.sku = sku + + +class CustomizedAcceleratorResourceCollection(_serialization.Model): + """CustomizedAcceleratorResourceCollection. + + :ivar value: + :vartype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource] + :ivar next_link: + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[CustomizedAcceleratorResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.CustomizedAcceleratorResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource] + :keyword next_link: + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class CustomizedAcceleratorValidateResult(_serialization.Model): + """Validation result for customized accelerator properties. + + :ivar state: State of the customized accelerator validation result. Known values are: "Valid" + and "Invalid". + :vartype state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorValidateResultState + :ivar error_message: The detail validation results. + :vartype error_message: str + """ + + _attribute_map = { + "state": {"key": "state", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + } + + def __init__( + self, + *, + state: Union[str, "_models.CustomizedAcceleratorValidateResultState"] = "Valid", + error_message: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword state: State of the customized accelerator validation result. Known values are: + "Valid" and "Invalid". + :paramtype state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorValidateResultState + :keyword error_message: The detail validation results. + :paramtype error_message: str + """ + super().__init__(**kwargs) + self.state = state + self.error_message = error_message + + +class CustomPersistentDiskResource(_serialization.Model): + """Custom persistent disk resource payload. + + All required parameters must be populated in order to send to server. + + :ivar custom_persistent_disk_properties: Properties of the custom persistent disk resource + payload. + :vartype custom_persistent_disk_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomPersistentDiskProperties + :ivar storage_id: The resource id of Azure Spring Apps Storage resource. Required. + :vartype storage_id: str + """ + + _validation = { + "storage_id": {"required": True}, + } + + _attribute_map = { + "custom_persistent_disk_properties": { + "key": "customPersistentDiskProperties", + "type": "CustomPersistentDiskProperties", + }, + "storage_id": {"key": "storageId", "type": "str"}, + } + + def __init__( + self, + *, + storage_id: str, + custom_persistent_disk_properties: Optional["_models.CustomPersistentDiskProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword custom_persistent_disk_properties: Properties of the custom persistent disk resource + payload. + :paramtype custom_persistent_disk_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomPersistentDiskProperties + :keyword storage_id: The resource id of Azure Spring Apps Storage resource. Required. + :paramtype storage_id: str + """ + super().__init__(**kwargs) + self.custom_persistent_disk_properties = custom_persistent_disk_properties + self.storage_id = storage_id + + +class CustomScaleRule(_serialization.Model): + """Azure Spring Apps App Instance Custom scaling rule. + + :ivar type: Type of the custom scale rule + eg: azure-servicebus, redis etc. + :vartype type: str + :ivar metadata: Metadata properties to describe custom scale rule. + :vartype metadata: dict[str, str] + :ivar auth: Authentication secrets for the custom scale rule. + :vartype auth: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ScaleRuleAuth] + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "metadata": {"key": "metadata", "type": "{str}"}, + "auth": {"key": "auth", "type": "[ScaleRuleAuth]"}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + metadata: Optional[Dict[str, str]] = None, + auth: Optional[List["_models.ScaleRuleAuth"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: Type of the custom scale rule + eg: azure-servicebus, redis etc. + :paramtype type: str + :keyword metadata: Metadata properties to describe custom scale rule. + :paramtype metadata: dict[str, str] + :keyword auth: Authentication secrets for the custom scale rule. + :paramtype auth: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ScaleRuleAuth] + """ + super().__init__(**kwargs) + self.type = type + self.metadata = metadata + self.auth = auth + + +class DeploymentInstance(_serialization.Model): + """Deployment instance payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the deployment instance. + :vartype name: str + :ivar status: Status of the deployment instance. + :vartype status: str + :ivar reason: Failed reason of the deployment instance. + :vartype reason: str + :ivar discovery_status: Discovery status of the deployment instance. + :vartype discovery_status: str + :ivar start_time: Start time of the deployment instance. + :vartype start_time: str + :ivar zone: Availability zone information of the deployment instance. + :vartype zone: str + """ + + _validation = { + "name": {"readonly": True}, + "status": {"readonly": True}, + "reason": {"readonly": True}, + "discovery_status": {"readonly": True}, + "start_time": {"readonly": True}, + "zone": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "reason": {"key": "reason", "type": "str"}, + "discovery_status": {"key": "discoveryStatus", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "zone": {"key": "zone", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.status = None + self.reason = None + self.discovery_status = None + self.start_time = None + self.zone = None + + +class DeploymentList(_serialization.Model): + """A list of deployments resource ids. + + :ivar deployments: A list of deployment resource ids. + :vartype deployments: list[str] + """ + + _attribute_map = { + "deployments": {"key": "deployments", "type": "[str]"}, + } + + def __init__(self, *, deployments: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword deployments: A list of deployment resource ids. + :paramtype deployments: list[str] + """ + super().__init__(**kwargs) + self.deployments = deployments + + +class DeploymentResource(ProxyResource): + """Deployment resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of the Deployment resource. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResourceProperties + :ivar sku: Sku of the Deployment resource. + :vartype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DeploymentResourceProperties"}, + "sku": {"key": "sku", "type": "Sku"}, + } + + def __init__( + self, + *, + properties: Optional["_models.DeploymentResourceProperties"] = None, + sku: Optional["_models.Sku"] = None, + **kwargs: Any + ) -> None: + """ + :keyword properties: Properties of the Deployment resource. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResourceProperties + :keyword sku: Sku of the Deployment resource. + :paramtype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + super().__init__(**kwargs) + self.properties = properties + self.sku = sku + + +class DeploymentResourceCollection(_serialization.Model): + """Object that includes an array of App resources and a possible link for next set. + + :ivar value: Collection of Deployment resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[DeploymentResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.DeploymentResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Deployment resources. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DeploymentResourceProperties(_serialization.Model): + """Deployment resource properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar source: Uploaded source information of the deployment. + :vartype source: ~azure.mgmt.appplatform.v2024_05_01_preview.models.UserSourceInfo + :ivar deployment_settings: Deployment settings of the Deployment. + :vartype deployment_settings: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentSettings + :ivar provisioning_state: Provisioning state of the Deployment. Known values are: "Creating", + "Updating", "Succeeded", and "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResourceProvisioningState + :ivar status: Status of the Deployment. Known values are: "Stopped" and "Running". + :vartype status: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResourceStatus + :ivar active: Indicates whether the Deployment is active. + :vartype active: bool + :ivar instances: Collection of instances belong to the Deployment. + :vartype instances: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentInstance] + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "status": {"readonly": True}, + "instances": {"readonly": True}, + } + + _attribute_map = { + "source": {"key": "source", "type": "UserSourceInfo"}, + "deployment_settings": {"key": "deploymentSettings", "type": "DeploymentSettings"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "active": {"key": "active", "type": "bool"}, + "instances": {"key": "instances", "type": "[DeploymentInstance]"}, + } + + def __init__( + self, + *, + source: Optional["_models.UserSourceInfo"] = None, + deployment_settings: Optional["_models.DeploymentSettings"] = None, + active: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword source: Uploaded source information of the deployment. + :paramtype source: ~azure.mgmt.appplatform.v2024_05_01_preview.models.UserSourceInfo + :keyword deployment_settings: Deployment settings of the Deployment. + :paramtype deployment_settings: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentSettings + :keyword active: Indicates whether the Deployment is active. + :paramtype active: bool + """ + super().__init__(**kwargs) + self.source = source + self.deployment_settings = deployment_settings + self.provisioning_state = None + self.status = None + self.active = active + self.instances = None + + +class DeploymentSettings(_serialization.Model): + """Deployment settings payload. + + :ivar resource_requests: The requested resource quantity for required CPU and Memory. It is + recommended that using this field to represent the required CPU and Memory, the old field cpu + and memoryInGB will be deprecated later. + :vartype resource_requests: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceRequests + :ivar environment_variables: Collection of environment variables. + :vartype environment_variables: dict[str, str] + :ivar apms: Collection of ApmReferences. + :vartype apms: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmReference] + :ivar addon_configs: Collection of addons. + :vartype addon_configs: dict[str, JSON] + :ivar liveness_probe: Periodic probe of App Instance liveness. App Instance will be restarted + if the probe fails. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + :vartype liveness_probe: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Probe + :ivar readiness_probe: Periodic probe of App Instance service readiness. App Instance will be + removed from service endpoints if the probe fails. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + :vartype readiness_probe: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Probe + :ivar startup_probe: StartupProbe indicates that the App Instance has successfully initialized. + If specified, no other probes are executed until this completes successfully. If this probe + fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to + provide different probe parameters at the beginning of a App Instance's lifecycle, when it + might take a long time to load data or warm a cache, than during steady-state operation. This + cannot be updated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + :vartype startup_probe: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Probe + :ivar termination_grace_period_seconds: Optional duration in seconds the App Instance needs to + terminate gracefully. May be decreased in delete request. Value must be non-negative integer. + The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If + this value is nil, the default grace period will be used instead. The grace period is the + duration in seconds after the processes running in the App Instance are sent a termination + signal and the time when the processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults to 90 seconds. + :vartype termination_grace_period_seconds: int + :ivar scale: Scaling properties for the Azure Spring Apps App Instance. + :vartype scale: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Scale + :ivar container_probe_settings: Container liveness and readiness probe settings. + :vartype container_probe_settings: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerProbeSettings + """ + + _attribute_map = { + "resource_requests": {"key": "resourceRequests", "type": "ResourceRequests"}, + "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "apms": {"key": "apms", "type": "[ApmReference]"}, + "addon_configs": {"key": "addonConfigs", "type": "{object}"}, + "liveness_probe": {"key": "livenessProbe", "type": "Probe"}, + "readiness_probe": {"key": "readinessProbe", "type": "Probe"}, + "startup_probe": {"key": "startupProbe", "type": "Probe"}, + "termination_grace_period_seconds": {"key": "terminationGracePeriodSeconds", "type": "int"}, + "scale": {"key": "scale", "type": "Scale"}, + "container_probe_settings": {"key": "containerProbeSettings", "type": "ContainerProbeSettings"}, + } + + def __init__( + self, + *, + resource_requests: Optional["_models.ResourceRequests"] = None, + environment_variables: Optional[Dict[str, str]] = None, + apms: Optional[List["_models.ApmReference"]] = None, + addon_configs: Optional[Dict[str, JSON]] = None, + liveness_probe: Optional["_models.Probe"] = None, + readiness_probe: Optional["_models.Probe"] = None, + startup_probe: Optional["_models.Probe"] = None, + termination_grace_period_seconds: int = 90, + scale: Optional["_models.Scale"] = None, + container_probe_settings: Optional["_models.ContainerProbeSettings"] = None, + **kwargs: Any + ) -> None: + """ + :keyword resource_requests: The requested resource quantity for required CPU and Memory. It is + recommended that using this field to represent the required CPU and Memory, the old field cpu + and memoryInGB will be deprecated later. + :paramtype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceRequests + :keyword environment_variables: Collection of environment variables. + :paramtype environment_variables: dict[str, str] + :keyword apms: Collection of ApmReferences. + :paramtype apms: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmReference] + :keyword addon_configs: Collection of addons. + :paramtype addon_configs: dict[str, JSON] + :keyword liveness_probe: Periodic probe of App Instance liveness. App Instance will be + restarted if the probe fails. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + :paramtype liveness_probe: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Probe + :keyword readiness_probe: Periodic probe of App Instance service readiness. App Instance will + be removed from service endpoints if the probe fails. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + :paramtype readiness_probe: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Probe + :keyword startup_probe: StartupProbe indicates that the App Instance has successfully + initialized. If specified, no other probes are executed until this completes successfully. If + this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be + used to provide different probe parameters at the beginning of a App Instance's lifecycle, when + it might take a long time to load data or warm a cache, than during steady-state operation. + This cannot be updated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + :paramtype startup_probe: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Probe + :keyword termination_grace_period_seconds: Optional duration in seconds the App Instance needs + to terminate gracefully. May be decreased in delete request. Value must be non-negative + integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut + down). If this value is nil, the default grace period will be used instead. The grace period is + the duration in seconds after the processes running in the App Instance are sent a termination + signal and the time when the processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults to 90 seconds. + :paramtype termination_grace_period_seconds: int + :keyword scale: Scaling properties for the Azure Spring Apps App Instance. + :paramtype scale: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Scale + :keyword container_probe_settings: Container liveness and readiness probe settings. + :paramtype container_probe_settings: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerProbeSettings + """ + super().__init__(**kwargs) + self.resource_requests = resource_requests + self.environment_variables = environment_variables + self.apms = apms + self.addon_configs = addon_configs + self.liveness_probe = liveness_probe + self.readiness_probe = readiness_probe + self.startup_probe = startup_probe + self.termination_grace_period_seconds = termination_grace_period_seconds + self.scale = scale + self.container_probe_settings = container_probe_settings + + +class DevToolPortalComponent(_serialization.Model): + """DevToolPortalComponent. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: + :vartype name: str + :ivar resource_requests: The requested resource quantity for required CPU and Memory. + :vartype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResourceRequests + :ivar instances: Collection of instances belong to Dev Tool Portal. + :vartype instances: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalInstance] + """ + + _validation = { + "name": {"readonly": True}, + "resource_requests": {"readonly": True}, + "instances": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "resource_requests": {"key": "resourceRequests", "type": "DevToolPortalResourceRequests"}, + "instances": {"key": "instances", "type": "[DevToolPortalInstance]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.resource_requests = None + self.instances = None + + +class DevToolPortalFeatureDetail(_serialization.Model): + """Detail settings for Dev Tool Portal feature. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar state: State of the plugin. Known values are: "Enabled" and "Disabled". + :vartype state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalFeatureState + :ivar route: Route path to visit the plugin. + :vartype route: str + """ + + _validation = { + "route": {"readonly": True}, + } + + _attribute_map = { + "state": {"key": "state", "type": "str"}, + "route": {"key": "route", "type": "str"}, + } + + def __init__(self, *, state: Union[str, "_models.DevToolPortalFeatureState"] = "Enabled", **kwargs: Any) -> None: + """ + :keyword state: State of the plugin. Known values are: "Enabled" and "Disabled". + :paramtype state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalFeatureState + """ + super().__init__(**kwargs) + self.state = state + self.route = None + + +class DevToolPortalFeatureSettings(_serialization.Model): + """Settings for Dev Tool Portal. + + :ivar application_accelerator: Detail of Accelerator plugin. + :vartype application_accelerator: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalFeatureDetail + :ivar application_live_view: Detail of App Live View plugin. + :vartype application_live_view: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalFeatureDetail + """ + + _attribute_map = { + "application_accelerator": {"key": "applicationAccelerator", "type": "DevToolPortalFeatureDetail"}, + "application_live_view": {"key": "applicationLiveView", "type": "DevToolPortalFeatureDetail"}, + } + + def __init__( + self, + *, + application_accelerator: Optional["_models.DevToolPortalFeatureDetail"] = None, + application_live_view: Optional["_models.DevToolPortalFeatureDetail"] = None, + **kwargs: Any + ) -> None: + """ + :keyword application_accelerator: Detail of Accelerator plugin. + :paramtype application_accelerator: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalFeatureDetail + :keyword application_live_view: Detail of App Live View plugin. + :paramtype application_live_view: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalFeatureDetail + """ + super().__init__(**kwargs) + self.application_accelerator = application_accelerator + self.application_live_view = application_live_view + + +class DevToolPortalInstance(_serialization.Model): + """Collection of instances belong to the Dev Tool Portal. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the Dev Tool Portal instance. + :vartype name: str + :ivar status: Status of the Dev Tool Portal instance. It can be Pending, Running, Succeeded, + Failed, Unknown. + :vartype status: str + """ + + _validation = { + "name": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.status = None + + +class DevToolPortalProperties(_serialization.Model): + """Dev Tool Portal properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: State of the Dev Tool Portal. Known values are: "Creating", + "Updating", "Succeeded", "Failed", "Deleting", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalProvisioningState + :ivar components: Collection of components belong to Dev Tool Portal. + :vartype components: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalComponent] + :ivar public: Indicates whether the resource exposes public endpoint. + :vartype public: bool + :ivar url: URL of the resource, exposed when 'public' is true. + :vartype url: str + :ivar sso_properties: Single sign-on related configuration. + :vartype sso_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalSsoProperties + :ivar features: Settings for Dev Tool Portal. + :vartype features: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalFeatureSettings + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "components": {"readonly": True}, + "url": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "components": {"key": "components", "type": "[DevToolPortalComponent]"}, + "public": {"key": "public", "type": "bool"}, + "url": {"key": "url", "type": "str"}, + "sso_properties": {"key": "ssoProperties", "type": "DevToolPortalSsoProperties"}, + "features": {"key": "features", "type": "DevToolPortalFeatureSettings"}, + } + + def __init__( + self, + *, + public: bool = False, + sso_properties: Optional["_models.DevToolPortalSsoProperties"] = None, + features: Optional["_models.DevToolPortalFeatureSettings"] = None, + **kwargs: Any + ) -> None: + """ + :keyword public: Indicates whether the resource exposes public endpoint. + :paramtype public: bool + :keyword sso_properties: Single sign-on related configuration. + :paramtype sso_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalSsoProperties + :keyword features: Settings for Dev Tool Portal. + :paramtype features: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalFeatureSettings + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.components = None + self.public = public + self.url = None + self.sso_properties = sso_properties + self.features = features + + +class DevToolPortalResource(ProxyResource): + """Dev Tool Portal resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Dev Tool Portal properties payload. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DevToolPortalProperties"}, + } + + def __init__(self, *, properties: Optional["_models.DevToolPortalProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Dev Tool Portal properties payload. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class DevToolPortalResourceCollection(_serialization.Model): + """Object that includes an array of Dev Tool Portal resources and a possible link for next set. + + :ivar value: Collection of Dev Tool Portal resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[DevToolPortalResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.DevToolPortalResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Dev Tool Portal resources. + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DevToolPortalResourceRequests(_serialization.Model): + """The resource quantity for required CPU and Memory of Dev Tool Portal. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cpu: Cpu quantity allocated to each Dev Tool Portal instance. 1 core can be represented + by 1 or 1000m. + :vartype cpu: str + :ivar memory: Memory quantity allocated to each Dev Tool Portal instance. 1 GB can be + represented by 1Gi or 1024Mi. + :vartype memory: str + :ivar instance_count: Desired instance count of Dev Tool Portal. + :vartype instance_count: int + """ + + _validation = { + "cpu": {"readonly": True}, + "memory": {"readonly": True}, + "instance_count": {"readonly": True}, + } + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.cpu = None + self.memory = None + self.instance_count = None + + +class DevToolPortalSsoProperties(_serialization.Model): + """Single sign-on related configuration. + + :ivar scopes: It defines the specific actions applications can be allowed to do on a user's + behalf. + :vartype scopes: list[str] + :ivar client_id: The public identifier for the application. + :vartype client_id: str + :ivar client_secret: The secret known only to the application and the authorization server. + :vartype client_secret: str + :ivar metadata_url: The URI of a JSON file with generic OIDC provider configuration. + :vartype metadata_url: str + """ + + _attribute_map = { + "scopes": {"key": "scopes", "type": "[str]"}, + "client_id": {"key": "clientId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, + "metadata_url": {"key": "metadataUrl", "type": "str"}, + } + + def __init__( + self, + *, + scopes: Optional[List[str]] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + metadata_url: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword scopes: It defines the specific actions applications can be allowed to do on a user's + behalf. + :paramtype scopes: list[str] + :keyword client_id: The public identifier for the application. + :paramtype client_id: str + :keyword client_secret: The secret known only to the application and the authorization server. + :paramtype client_secret: str + :keyword metadata_url: The URI of a JSON file with generic OIDC provider configuration. + :paramtype metadata_url: str + """ + super().__init__(**kwargs) + self.scopes = scopes + self.client_id = client_id + self.client_secret = client_secret + self.metadata_url = metadata_url + + +class DiagnosticParameters(_serialization.Model): + """Diagnostic parameters of diagnostic operations. + + :ivar app_instance: App instance name. + :vartype app_instance: str + :ivar file_path: Your target file path in your own BYOS. + :vartype file_path: str + :ivar duration: Duration of your JFR. 1 min can be represented by 1m or 60s. + :vartype duration: str + """ + + _attribute_map = { + "app_instance": {"key": "appInstance", "type": "str"}, + "file_path": {"key": "filePath", "type": "str"}, + "duration": {"key": "duration", "type": "str"}, + } + + def __init__( + self, + *, + app_instance: Optional[str] = None, + file_path: Optional[str] = None, + duration: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword app_instance: App instance name. + :paramtype app_instance: str + :keyword file_path: Your target file path in your own BYOS. + :paramtype file_path: str + :keyword duration: Duration of your JFR. 1 min can be represented by 1m or 60s. + :paramtype duration: str + """ + super().__init__(**kwargs) + self.app_instance = app_instance + self.file_path = file_path + self.duration = duration + + +class EnvSecretsCollection(_serialization.Model): + """Secret environment variable collection. + + All required parameters must be populated in order to send to server. + + :ivar value: Collection of resources. Required. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.Secret] + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Secret]"}, + } + + def __init__(self, *, value: List["_models.Secret"], **kwargs: Any) -> None: + """ + :keyword value: Collection of resources. Required. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.Secret] + """ + super().__init__(**kwargs) + self.value = value + + +class EnvVar(_serialization.Model): + """Azure Spring Apps components' environment variable. + + :ivar name: Environment variable name. + :vartype name: str + :ivar value: Non-secret environment variable value. + :vartype value: str + :ivar secret_value: secret environment variable value. + :vartype secret_value: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "secret_value": {"key": "secretValue", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + secret_value: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Environment variable name. + :paramtype name: str + :keyword value: Non-secret environment variable value. + :paramtype value: str + :keyword secret_value: secret environment variable value. + :paramtype secret_value: str + """ + super().__init__(**kwargs) + self.name = name + self.value = value + self.secret_value = secret_value + + +class Error(_serialization.Model): + """The error code compose of code and message. + + :ivar code: The code of error. + :vartype code: str + :ivar message: The message of error. + :vartype message: str + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + } + + def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword code: The code of error. + :paramtype code: str + :keyword message: The message of error. + :paramtype message: str + """ + super().__init__(**kwargs) + self.code = code + self.message = message + + +class EurekaServerProperties(_serialization.Model): + """Eureka server properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: State of the eureka server. Known values are: "Failed", "Succeeded", + "Updating", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerState + :ivar enabled_state: Enabled state of the eureka server. This is only used in Consumption tier. + Known values are: "Enabled" and "Disabled". + :vartype enabled_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerEnabledState + :ivar error: Error when applying eureka server settings. + :vartype error: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Error + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "enabled_state": {"key": "enabledState", "type": "str"}, + "error": {"key": "error", "type": "Error"}, + } + + def __init__( + self, + *, + enabled_state: Optional[Union[str, "_models.EurekaServerEnabledState"]] = None, + error: Optional["_models.Error"] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled_state: Enabled state of the eureka server. This is only used in Consumption + tier. Known values are: "Enabled" and "Disabled". + :paramtype enabled_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerEnabledState + :keyword error: Error when applying eureka server settings. + :paramtype error: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Error + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.enabled_state = enabled_state + self.error = error + + +class EurekaServerResource(ProxyResource): + """Eureka server resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of the eureka server resource. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "EurekaServerProperties"}, + } + + def __init__(self, *, properties: Optional["_models.EurekaServerProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of the eureka server resource. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class EurekaServerResourceCollection(_serialization.Model): + """Object that includes an array of Eureka server resources and a possible link for next set. + + :ivar value: Collection of Eureka server resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[EurekaServerResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.EurekaServerResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Eureka server resources. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ProbeAction(_serialization.Model): + """The action of the probe. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ExecAction, HTTPGetAction, TCPSocketAction + + All required parameters must be populated in order to send to server. + + :ivar type: The type of the action to take to perform the health check. Required. Known values + are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". + :vartype type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.ProbeActionType + """ + + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + } + + _subtype_map = { + "type": {"ExecAction": "ExecAction", "HTTPGetAction": "HTTPGetAction", "TCPSocketAction": "TCPSocketAction"} + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.type: Optional[str] = None + + +class ExecAction(ProbeAction): + """ExecAction describes a "run in container" action. + + All required parameters must be populated in order to send to server. + + :ivar type: The type of the action to take to perform the health check. Required. Known values + are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". + :vartype type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.ProbeActionType + :ivar command: Command is the command line to execute inside the container, the working + directory for the command is root ('/') in the container's filesystem. The command is not run + inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and + non-zero is unhealthy. + :vartype command: list[str] + """ + + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "command": {"key": "command", "type": "[str]"}, + } + + def __init__(self, *, command: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword command: Command is the command line to execute inside the container, the working + directory for the command is root ('/') in the container's filesystem. The command is not run + inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and + non-zero is unhealthy. + :paramtype command: list[str] + """ + super().__init__(**kwargs) + self.type: str = "ExecAction" + self.command = command + + +class GatewayApiMetadataProperties(_serialization.Model): + """API metadata property for Spring Cloud Gateway. + + :ivar title: Title describing the context of the APIs available on the Gateway instance + (default: ``Spring Cloud Gateway for K8S``\ ). + :vartype title: str + :ivar description: Detailed description of the APIs available on the Gateway instance (default: + ``Generated OpenAPI 3 document that describes the API routes configured.``\ ). + :vartype description: str + :ivar documentation: Location of additional documentation for the APIs available on the Gateway + instance. + :vartype documentation: str + :ivar version: Version of APIs available on this Gateway instance (default: ``unspecified``\ ). + :vartype version: str + :ivar server_url: Base URL that API consumers will use to access APIs on the Gateway instance. + :vartype server_url: str + """ + + _attribute_map = { + "title": {"key": "title", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "documentation": {"key": "documentation", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "server_url": {"key": "serverUrl", "type": "str"}, + } + + def __init__( + self, + *, + title: Optional[str] = None, + description: Optional[str] = None, + documentation: Optional[str] = None, + version: Optional[str] = None, + server_url: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword title: Title describing the context of the APIs available on the Gateway instance + (default: ``Spring Cloud Gateway for K8S``\ ). + :paramtype title: str + :keyword description: Detailed description of the APIs available on the Gateway instance + (default: ``Generated OpenAPI 3 document that describes the API routes configured.``\ ). + :paramtype description: str + :keyword documentation: Location of additional documentation for the APIs available on the + Gateway instance. + :paramtype documentation: str + :keyword version: Version of APIs available on this Gateway instance (default: ``unspecified``\ + ). + :paramtype version: str + :keyword server_url: Base URL that API consumers will use to access APIs on the Gateway + instance. + :paramtype server_url: str + """ + super().__init__(**kwargs) + self.title = title + self.description = description + self.documentation = documentation + self.version = version + self.server_url = server_url + + +class GatewayApiRoute(_serialization.Model): + """API route config of the Spring Cloud Gateway. + + :ivar title: A title, will be applied to methods in the generated OpenAPI documentation. + :vartype title: str + :ivar description: A description, will be applied to methods in the generated OpenAPI + documentation. + :vartype description: str + :ivar uri: Full uri, will override ``appName``. + :vartype uri: str + :ivar sso_enabled: Enable sso validation. + :vartype sso_enabled: bool + :ivar token_relay: Pass currently-authenticated user's identity token to application service, + default is 'false'. + :vartype token_relay: bool + :ivar predicates: A number of conditions to evaluate a route for each request. Each predicate + may be evaluated against request headers and parameter values. All of the predicates associated + with a route must evaluate to true for the route to be matched to the request. + :vartype predicates: list[str] + :ivar filters: To modify the request before sending it to the target endpoint, or the received + response. + :vartype filters: list[str] + :ivar order: Route processing order. + :vartype order: int + :ivar tags: Classification tags, will be applied to methods in the generated OpenAPI + documentation. + :vartype tags: list[str] + """ + + _attribute_map = { + "title": {"key": "title", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "sso_enabled": {"key": "ssoEnabled", "type": "bool"}, + "token_relay": {"key": "tokenRelay", "type": "bool"}, + "predicates": {"key": "predicates", "type": "[str]"}, + "filters": {"key": "filters", "type": "[str]"}, + "order": {"key": "order", "type": "int"}, + "tags": {"key": "tags", "type": "[str]"}, + } + + def __init__( + self, + *, + title: Optional[str] = None, + description: Optional[str] = None, + uri: Optional[str] = None, + sso_enabled: Optional[bool] = None, + token_relay: Optional[bool] = None, + predicates: Optional[List[str]] = None, + filters: Optional[List[str]] = None, + order: Optional[int] = None, + tags: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword title: A title, will be applied to methods in the generated OpenAPI documentation. + :paramtype title: str + :keyword description: A description, will be applied to methods in the generated OpenAPI + documentation. + :paramtype description: str + :keyword uri: Full uri, will override ``appName``. + :paramtype uri: str + :keyword sso_enabled: Enable sso validation. + :paramtype sso_enabled: bool + :keyword token_relay: Pass currently-authenticated user's identity token to application + service, default is 'false'. + :paramtype token_relay: bool + :keyword predicates: A number of conditions to evaluate a route for each request. Each + predicate may be evaluated against request headers and parameter values. All of the predicates + associated with a route must evaluate to true for the route to be matched to the request. + :paramtype predicates: list[str] + :keyword filters: To modify the request before sending it to the target endpoint, or the + received response. + :paramtype filters: list[str] + :keyword order: Route processing order. + :paramtype order: int + :keyword tags: Classification tags, will be applied to methods in the generated OpenAPI + documentation. + :paramtype tags: list[str] + """ + super().__init__(**kwargs) + self.title = title + self.description = description + self.uri = uri + self.sso_enabled = sso_enabled + self.token_relay = token_relay + self.predicates = predicates + self.filters = filters + self.order = order + self.tags = tags + + +class GatewayCorsProperties(_serialization.Model): + """Cross-Origin Resource Sharing property. + + :ivar allowed_origins: Allowed origins to make cross-site requests. The special value ``*`` + allows all domains. + :vartype allowed_origins: list[str] + :ivar allowed_origin_patterns: Allowed origin patterns to make cross-site requests. + :vartype allowed_origin_patterns: list[str] + :ivar allowed_methods: Allowed HTTP methods on cross-site requests. The special value ``*`` + allows all methods. If not set, ``GET`` and ``HEAD`` are allowed by default. + :vartype allowed_methods: list[str] + :ivar allowed_headers: Allowed headers in cross-site requests. The special value ``*`` allows + actual requests to send any header. + :vartype allowed_headers: list[str] + :ivar max_age: How long, in seconds, the response from a pre-flight request can be cached by + clients. + :vartype max_age: int + :ivar allow_credentials: Whether user credentials are supported on cross-site requests. Valid + values: ``true``\ , ``false``. + :vartype allow_credentials: bool + :ivar exposed_headers: HTTP response headers to expose for cross-site requests. + :vartype exposed_headers: list[str] + """ + + _attribute_map = { + "allowed_origins": {"key": "allowedOrigins", "type": "[str]"}, + "allowed_origin_patterns": {"key": "allowedOriginPatterns", "type": "[str]"}, + "allowed_methods": {"key": "allowedMethods", "type": "[str]"}, + "allowed_headers": {"key": "allowedHeaders", "type": "[str]"}, + "max_age": {"key": "maxAge", "type": "int"}, + "allow_credentials": {"key": "allowCredentials", "type": "bool"}, + "exposed_headers": {"key": "exposedHeaders", "type": "[str]"}, + } + + def __init__( + self, + *, + allowed_origins: Optional[List[str]] = None, + allowed_origin_patterns: Optional[List[str]] = None, + allowed_methods: Optional[List[str]] = None, + allowed_headers: Optional[List[str]] = None, + max_age: Optional[int] = None, + allow_credentials: Optional[bool] = None, + exposed_headers: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword allowed_origins: Allowed origins to make cross-site requests. The special value ``*`` + allows all domains. + :paramtype allowed_origins: list[str] + :keyword allowed_origin_patterns: Allowed origin patterns to make cross-site requests. + :paramtype allowed_origin_patterns: list[str] + :keyword allowed_methods: Allowed HTTP methods on cross-site requests. The special value ``*`` + allows all methods. If not set, ``GET`` and ``HEAD`` are allowed by default. + :paramtype allowed_methods: list[str] + :keyword allowed_headers: Allowed headers in cross-site requests. The special value ``*`` + allows actual requests to send any header. + :paramtype allowed_headers: list[str] + :keyword max_age: How long, in seconds, the response from a pre-flight request can be cached by + clients. + :paramtype max_age: int + :keyword allow_credentials: Whether user credentials are supported on cross-site requests. + Valid values: ``true``\ , ``false``. + :paramtype allow_credentials: bool + :keyword exposed_headers: HTTP response headers to expose for cross-site requests. + :paramtype exposed_headers: list[str] + """ + super().__init__(**kwargs) + self.allowed_origins = allowed_origins + self.allowed_origin_patterns = allowed_origin_patterns + self.allowed_methods = allowed_methods + self.allowed_headers = allowed_headers + self.max_age = max_age + self.allow_credentials = allow_credentials + self.exposed_headers = exposed_headers + + +class GatewayCustomDomainProperties(_serialization.Model): + """The properties of custom domain for Spring Cloud Gateway. + + :ivar thumbprint: The thumbprint of bound certificate. + :vartype thumbprint: str + """ + + _attribute_map = { + "thumbprint": {"key": "thumbprint", "type": "str"}, + } + + def __init__(self, *, thumbprint: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword thumbprint: The thumbprint of bound certificate. + :paramtype thumbprint: str + """ + super().__init__(**kwargs) + self.thumbprint = thumbprint + + +class GatewayCustomDomainResource(ProxyResource): + """Custom domain of the Spring Cloud Gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: The properties of custom domain for Spring Cloud Gateway. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "GatewayCustomDomainProperties"}, + } + + def __init__(self, *, properties: Optional["_models.GatewayCustomDomainProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: The properties of custom domain for Spring Cloud Gateway. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class GatewayCustomDomainResourceCollection(_serialization.Model): + """Object that includes an array of Spring Cloud Gateway custom domain resources and a possible + link for next set. + + :ivar value: Collection of Spring Cloud Gateway custom domain resources. + :vartype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[GatewayCustomDomainResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.GatewayCustomDomainResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Spring Cloud Gateway custom domain resources. + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GatewayInstance(_serialization.Model): + """Collection of instances belong to the Spring Cloud Gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the Spring Cloud Gateway instance. + :vartype name: str + :ivar status: Status of the Spring Cloud Gateway instance. + :vartype status: str + """ + + _validation = { + "name": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.status = None + + +class GatewayResponseCacheProperties(_serialization.Model): + """Spring Cloud Gateway response cache properties. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + GatewayLocalResponseCachePerInstanceProperties, GatewayLocalResponseCachePerRouteProperties + + All required parameters must be populated in order to send to server. + + :ivar response_cache_type: The type of the response cache. Required. + :vartype response_cache_type: str + """ + + _validation = { + "response_cache_type": {"required": True}, + } + + _attribute_map = { + "response_cache_type": {"key": "responseCacheType", "type": "str"}, + } + + _subtype_map = { + "response_cache_type": { + "LocalCachePerInstance": "GatewayLocalResponseCachePerInstanceProperties", + "LocalCachePerRoute": "GatewayLocalResponseCachePerRouteProperties", + } + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.response_cache_type: Optional[str] = None + + +class GatewayLocalResponseCachePerInstanceProperties(GatewayResponseCacheProperties): # pylint: disable=name-too-long + """Spring Cloud Gateway local response cache per instance properties. + + All required parameters must be populated in order to send to server. + + :ivar response_cache_type: The type of the response cache. Required. + :vartype response_cache_type: str + :ivar size: Maximum size of cache (10MB, 900KB, 1GB...) to determine if the cache needs to + evict some entries. + :vartype size: str + :ivar time_to_live: Time before a cached entry is expired (300s, 5m, 1h...). + :vartype time_to_live: str + """ + + _validation = { + "response_cache_type": {"required": True}, + } + + _attribute_map = { + "response_cache_type": {"key": "responseCacheType", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "time_to_live": {"key": "timeToLive", "type": "str"}, + } + + def __init__(self, *, size: Optional[str] = None, time_to_live: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword size: Maximum size of cache (10MB, 900KB, 1GB...) to determine if the cache needs to + evict some entries. + :paramtype size: str + :keyword time_to_live: Time before a cached entry is expired (300s, 5m, 1h...). + :paramtype time_to_live: str + """ + super().__init__(**kwargs) + self.response_cache_type: str = "LocalCachePerInstance" + self.size = size + self.time_to_live = time_to_live + + +class GatewayLocalResponseCachePerRouteProperties(GatewayResponseCacheProperties): # pylint: disable=name-too-long + """Spring Cloud Gateway local response cache per route properties. + + All required parameters must be populated in order to send to server. + + :ivar response_cache_type: The type of the response cache. Required. + :vartype response_cache_type: str + :ivar size: Maximum size of cache (10MB, 900KB, 1GB...) to determine if the cache needs to + evict some entries. + :vartype size: str + :ivar time_to_live: Time before a cached entry is expired (300s, 5m, 1h...). + :vartype time_to_live: str + """ + + _validation = { + "response_cache_type": {"required": True}, + } + + _attribute_map = { + "response_cache_type": {"key": "responseCacheType", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "time_to_live": {"key": "timeToLive", "type": "str"}, + } + + def __init__(self, *, size: Optional[str] = None, time_to_live: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword size: Maximum size of cache (10MB, 900KB, 1GB...) to determine if the cache needs to + evict some entries. + :paramtype size: str + :keyword time_to_live: Time before a cached entry is expired (300s, 5m, 1h...). + :paramtype time_to_live: str + """ + super().__init__(**kwargs) + self.response_cache_type: str = "LocalCachePerRoute" + self.size = size + self.time_to_live = time_to_live + + +class GatewayOperatorProperties(_serialization.Model): + """Properties of the Spring Cloud Gateway Operator. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_requests: The requested resource quantity for required CPU and Memory. + :vartype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayOperatorResourceRequests + :ivar instances: Collection of instances belong to Spring Cloud Gateway operator. + :vartype instances: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayInstance] + """ + + _validation = { + "resource_requests": {"readonly": True}, + "instances": {"readonly": True}, + } + + _attribute_map = { + "resource_requests": {"key": "resourceRequests", "type": "GatewayOperatorResourceRequests"}, + "instances": {"key": "instances", "type": "[GatewayInstance]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.resource_requests = None + self.instances = None + + +class GatewayOperatorResourceRequests(_serialization.Model): + """Properties of the Spring Cloud Gateway Operator. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cpu: CPU allocated to each Spring Cloud Gateway Operator instance. + :vartype cpu: str + :ivar memory: Memory allocated to each Spring Cloud Gateway Operator instance. + :vartype memory: str + :ivar instance_count: Instance count of the Spring Cloud Gateway Operator. + :vartype instance_count: int + """ + + _validation = { + "cpu": {"readonly": True}, + "memory": {"readonly": True}, + "instance_count": {"readonly": True}, + } + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.cpu = None + self.memory = None + self.instance_count = None + + +class GatewayProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Spring Cloud Gateway properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: State of the Spring Cloud Gateway. Known values are: "Creating", + "Updating", "Succeeded", "Failed", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayProvisioningState + :ivar public: Indicates whether the Spring Cloud Gateway exposes endpoint. + :vartype public: bool + :ivar url: URL of the Spring Cloud Gateway, exposed when 'public' is true. + :vartype url: str + :ivar https_only: Indicate if only https is allowed. + :vartype https_only: bool + :ivar sso_properties: Single sign-on related configuration. + :vartype sso_properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SsoProperties + :ivar api_metadata_properties: API metadata property for Spring Cloud Gateway. + :vartype api_metadata_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayApiMetadataProperties + :ivar cors_properties: Cross-Origin Resource Sharing property. + :vartype cors_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCorsProperties + :ivar client_auth: Client-Certification Authentication. + :vartype client_auth: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayPropertiesClientAuth + :ivar apm_types: Collection of APM type used in Spring Cloud Gateway. + :vartype apm_types: list[str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmType] + :ivar apms: Collection of ApmReferences in service level. + :vartype apms: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmReference] + :ivar environment_variables: Environment variables of Spring Cloud Gateway. + :vartype environment_variables: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayPropertiesEnvironmentVariables + :ivar resource_requests: The requested resource quantity for required CPU and Memory. + :vartype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResourceRequests + :ivar addon_configs: Collection of addons for Spring Cloud Gateway. + :vartype addon_configs: dict[str, JSON] + :ivar instances: Collection of instances belong to Spring Cloud Gateway. + :vartype instances: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayInstance] + :ivar operator_properties: Properties of the Spring Cloud Gateway Operator. + :vartype operator_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayOperatorProperties + :ivar response_cache_properties: The properties to configure different types of response cache + for Spring Cloud Gateway. + :vartype response_cache_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResponseCacheProperties + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "url": {"readonly": True}, + "apm_types": {"unique": True}, + "instances": {"readonly": True}, + "operator_properties": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "public": {"key": "public", "type": "bool"}, + "url": {"key": "url", "type": "str"}, + "https_only": {"key": "httpsOnly", "type": "bool"}, + "sso_properties": {"key": "ssoProperties", "type": "SsoProperties"}, + "api_metadata_properties": {"key": "apiMetadataProperties", "type": "GatewayApiMetadataProperties"}, + "cors_properties": {"key": "corsProperties", "type": "GatewayCorsProperties"}, + "client_auth": {"key": "clientAuth", "type": "GatewayPropertiesClientAuth"}, + "apm_types": {"key": "apmTypes", "type": "[str]"}, + "apms": {"key": "apms", "type": "[ApmReference]"}, + "environment_variables": {"key": "environmentVariables", "type": "GatewayPropertiesEnvironmentVariables"}, + "resource_requests": {"key": "resourceRequests", "type": "GatewayResourceRequests"}, + "addon_configs": {"key": "addonConfigs", "type": "{object}"}, + "instances": {"key": "instances", "type": "[GatewayInstance]"}, + "operator_properties": {"key": "operatorProperties", "type": "GatewayOperatorProperties"}, + "response_cache_properties": {"key": "responseCacheProperties", "type": "GatewayResponseCacheProperties"}, + } + + def __init__( + self, + *, + public: bool = False, + https_only: bool = False, + sso_properties: Optional["_models.SsoProperties"] = None, + api_metadata_properties: Optional["_models.GatewayApiMetadataProperties"] = None, + cors_properties: Optional["_models.GatewayCorsProperties"] = None, + client_auth: Optional["_models.GatewayPropertiesClientAuth"] = None, + apm_types: Optional[List[Union[str, "_models.ApmType"]]] = None, + apms: Optional[List["_models.ApmReference"]] = None, + environment_variables: Optional["_models.GatewayPropertiesEnvironmentVariables"] = None, + resource_requests: Optional["_models.GatewayResourceRequests"] = None, + addon_configs: Optional[Dict[str, JSON]] = None, + response_cache_properties: Optional["_models.GatewayResponseCacheProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword public: Indicates whether the Spring Cloud Gateway exposes endpoint. + :paramtype public: bool + :keyword https_only: Indicate if only https is allowed. + :paramtype https_only: bool + :keyword sso_properties: Single sign-on related configuration. + :paramtype sso_properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SsoProperties + :keyword api_metadata_properties: API metadata property for Spring Cloud Gateway. + :paramtype api_metadata_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayApiMetadataProperties + :keyword cors_properties: Cross-Origin Resource Sharing property. + :paramtype cors_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCorsProperties + :keyword client_auth: Client-Certification Authentication. + :paramtype client_auth: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayPropertiesClientAuth + :keyword apm_types: Collection of APM type used in Spring Cloud Gateway. + :paramtype apm_types: list[str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmType] + :keyword apms: Collection of ApmReferences in service level. + :paramtype apms: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmReference] + :keyword environment_variables: Environment variables of Spring Cloud Gateway. + :paramtype environment_variables: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayPropertiesEnvironmentVariables + :keyword resource_requests: The requested resource quantity for required CPU and Memory. + :paramtype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResourceRequests + :keyword addon_configs: Collection of addons for Spring Cloud Gateway. + :paramtype addon_configs: dict[str, JSON] + :keyword response_cache_properties: The properties to configure different types of response + cache for Spring Cloud Gateway. + :paramtype response_cache_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResponseCacheProperties + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.public = public + self.url = None + self.https_only = https_only + self.sso_properties = sso_properties + self.api_metadata_properties = api_metadata_properties + self.cors_properties = cors_properties + self.client_auth = client_auth + self.apm_types = apm_types + self.apms = apms + self.environment_variables = environment_variables + self.resource_requests = resource_requests + self.addon_configs = addon_configs + self.instances = None + self.operator_properties = None + self.response_cache_properties = response_cache_properties + + +class GatewayPropertiesClientAuth(_serialization.Model): + """Client-Certification Authentication. + + :ivar certificates: Collection of certificate resource Ids in Azure Spring Apps. + :vartype certificates: list[str] + :ivar certificate_verification: Whether to enable certificate verification or not. Known values + are: "Enabled" and "Disabled". + :vartype certificate_verification: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCertificateVerification + """ + + _validation = { + "certificates": {"unique": True}, + } + + _attribute_map = { + "certificates": {"key": "certificates", "type": "[str]"}, + "certificate_verification": {"key": "certificateVerification", "type": "str"}, + } + + def __init__( + self, + *, + certificates: Optional[List[str]] = None, + certificate_verification: Union[str, "_models.GatewayCertificateVerification"] = "Disabled", + **kwargs: Any + ) -> None: + """ + :keyword certificates: Collection of certificate resource Ids in Azure Spring Apps. + :paramtype certificates: list[str] + :keyword certificate_verification: Whether to enable certificate verification or not. Known + values are: "Enabled" and "Disabled". + :paramtype certificate_verification: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCertificateVerification + """ + super().__init__(**kwargs) + self.certificates = certificates + self.certificate_verification = certificate_verification + + +class GatewayPropertiesEnvironmentVariables(_serialization.Model): + """Environment variables of Spring Cloud Gateway. + + :ivar properties: Non-sensitive properties. + :vartype properties: dict[str, str] + :ivar secrets: Sensitive properties. + :vartype secrets: dict[str, str] + """ + + _attribute_map = { + "properties": {"key": "properties", "type": "{str}"}, + "secrets": {"key": "secrets", "type": "{str}"}, + } + + def __init__( + self, *, properties: Optional[Dict[str, str]] = None, secrets: Optional[Dict[str, str]] = None, **kwargs: Any + ) -> None: + """ + :keyword properties: Non-sensitive properties. + :paramtype properties: dict[str, str] + :keyword secrets: Sensitive properties. + :paramtype secrets: dict[str, str] + """ + super().__init__(**kwargs) + self.properties = properties + self.secrets = secrets + + +class GatewayResource(ProxyResource): + """Spring Cloud Gateway resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Spring Cloud Gateway properties payload. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayProperties + :ivar sku: Sku of the Spring Cloud Gateway resource. + :vartype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "GatewayProperties"}, + "sku": {"key": "sku", "type": "Sku"}, + } + + def __init__( + self, + *, + properties: Optional["_models.GatewayProperties"] = None, + sku: Optional["_models.Sku"] = None, + **kwargs: Any + ) -> None: + """ + :keyword properties: Spring Cloud Gateway properties payload. + :paramtype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayProperties + :keyword sku: Sku of the Spring Cloud Gateway resource. + :paramtype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + super().__init__(**kwargs) + self.properties = properties + self.sku = sku + + +class GatewayResourceCollection(_serialization.Model): + """Object that includes an array of gateway resources and a possible link for next set. + + :ivar value: Collection of gateway resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[GatewayResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.GatewayResource"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of gateway resources. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GatewayResourceRequests(_serialization.Model): + """Resource request payload of Spring Cloud Gateway. + + :ivar cpu: CPU allocated to each Spring Cloud Gateway instance. + :vartype cpu: str + :ivar memory: Memory allocated to each Spring Cloud Gateway instance. + :vartype memory: str + """ + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + } + + def __init__(self, *, cpu: str = "1", memory: str = "2Gi", **kwargs: Any) -> None: + """ + :keyword cpu: CPU allocated to each Spring Cloud Gateway instance. + :paramtype cpu: str + :keyword memory: Memory allocated to each Spring Cloud Gateway instance. + :paramtype memory: str + """ + super().__init__(**kwargs) + self.cpu = cpu + self.memory = memory + + +class GatewayRouteConfigOpenApiProperties(_serialization.Model): + """OpenAPI properties of Spring Cloud Gateway route config. + + :ivar uri: The URI of OpenAPI specification. + :vartype uri: str + """ + + _attribute_map = { + "uri": {"key": "uri", "type": "str"}, + } + + def __init__(self, *, uri: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword uri: The URI of OpenAPI specification. + :paramtype uri: str + """ + super().__init__(**kwargs) + self.uri = uri + + +class GatewayRouteConfigProperties(_serialization.Model): + """API route config of the Spring Cloud Gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: State of the Spring Cloud Gateway route config. Known values are: + "Creating", "Updating", "Succeeded", "Failed", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayProvisioningState + :ivar app_resource_id: The resource Id of the Azure Spring Apps app, required unless route + defines ``uri``. + :vartype app_resource_id: str + :ivar open_api: OpenAPI properties of Spring Cloud Gateway route config. + :vartype open_api: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigOpenApiProperties + :ivar protocol: Protocol of routed Azure Spring Apps applications. Known values are: "HTTP" and + "HTTPS". + :vartype protocol: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigProtocol + :ivar routes: Array of API routes, each route contains properties such as ``title``\ , ``uri``\ + , ``ssoEnabled``\ , ``predicates``\ , ``filters``. + :vartype routes: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayApiRoute] + :ivar sso_enabled: Enable Single Sign-On in app level. + :vartype sso_enabled: bool + :ivar predicates: A number of conditions to evaluate a route for each request in app level. + Each predicate may be evaluated against request headers and parameter values. All of the + predicates associated with a route must evaluate to true for the route to be matched to the + request. + :vartype predicates: list[str] + :ivar filters: To modify the request before sending it to the target endpoint, or the received + response in app level. + :vartype filters: list[str] + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "app_resource_id": {"key": "appResourceId", "type": "str"}, + "open_api": {"key": "openApi", "type": "GatewayRouteConfigOpenApiProperties"}, + "protocol": {"key": "protocol", "type": "str"}, + "routes": {"key": "routes", "type": "[GatewayApiRoute]"}, + "sso_enabled": {"key": "ssoEnabled", "type": "bool"}, + "predicates": {"key": "predicates", "type": "[str]"}, + "filters": {"key": "filters", "type": "[str]"}, + } + + def __init__( + self, + *, + app_resource_id: Optional[str] = None, + open_api: Optional["_models.GatewayRouteConfigOpenApiProperties"] = None, + protocol: Union[str, "_models.GatewayRouteConfigProtocol"] = "HTTP", + routes: Optional[List["_models.GatewayApiRoute"]] = None, + sso_enabled: Optional[bool] = None, + predicates: Optional[List[str]] = None, + filters: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword app_resource_id: The resource Id of the Azure Spring Apps app, required unless route + defines ``uri``. + :paramtype app_resource_id: str + :keyword open_api: OpenAPI properties of Spring Cloud Gateway route config. + :paramtype open_api: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigOpenApiProperties + :keyword protocol: Protocol of routed Azure Spring Apps applications. Known values are: "HTTP" + and "HTTPS". + :paramtype protocol: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigProtocol + :keyword routes: Array of API routes, each route contains properties such as ``title``\ , + ``uri``\ , ``ssoEnabled``\ , ``predicates``\ , ``filters``. + :paramtype routes: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayApiRoute] + :keyword sso_enabled: Enable Single Sign-On in app level. + :paramtype sso_enabled: bool + :keyword predicates: A number of conditions to evaluate a route for each request in app level. + Each predicate may be evaluated against request headers and parameter values. All of the + predicates associated with a route must evaluate to true for the route to be matched to the + request. + :paramtype predicates: list[str] + :keyword filters: To modify the request before sending it to the target endpoint, or the + received response in app level. + :paramtype filters: list[str] + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.app_resource_id = app_resource_id + self.open_api = open_api + self.protocol = protocol + self.routes = routes + self.sso_enabled = sso_enabled + self.predicates = predicates + self.filters = filters + + +class GatewayRouteConfigResource(ProxyResource): + """Spring Cloud Gateway route config resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: API route config of the Spring Cloud Gateway. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "GatewayRouteConfigProperties"}, + } + + def __init__(self, *, properties: Optional["_models.GatewayRouteConfigProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: API route config of the Spring Cloud Gateway. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class GatewayRouteConfigResourceCollection(_serialization.Model): + """Object that includes an array of Spring Cloud Gateway route config resources and a possible + link for next set. + + :ivar value: Collection of Spring Cloud Gateway route config resources. + :vartype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[GatewayRouteConfigResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.GatewayRouteConfigResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Spring Cloud Gateway route config resources. + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Git repository property payload for config server. + + All required parameters must be populated in order to send to server. + + :ivar name: Name of the repository. Required. + :vartype name: str + :ivar pattern: Collection of pattern of the repository. + :vartype pattern: list[str] + :ivar uri: URI of the repository. Required. + :vartype uri: str + :ivar label: Label of the repository. + :vartype label: str + :ivar search_paths: Searching path of the repository. + :vartype search_paths: list[str] + :ivar username: Username of git repository basic auth. + :vartype username: str + :ivar password: Password of git repository basic auth. + :vartype password: str + :ivar host_key: Public sshKey of git repository. + :vartype host_key: str + :ivar host_key_algorithm: SshKey algorithm of git repository. + :vartype host_key_algorithm: str + :ivar private_key: Private sshKey algorithm of git repository. + :vartype private_key: str + :ivar strict_host_key_checking: Strict host key checking or not. + :vartype strict_host_key_checking: bool + """ + + _validation = { + "name": {"required": True}, + "uri": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "pattern": {"key": "pattern", "type": "[str]"}, + "uri": {"key": "uri", "type": "str"}, + "label": {"key": "label", "type": "str"}, + "search_paths": {"key": "searchPaths", "type": "[str]"}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "host_key": {"key": "hostKey", "type": "str"}, + "host_key_algorithm": {"key": "hostKeyAlgorithm", "type": "str"}, + "private_key": {"key": "privateKey", "type": "str"}, + "strict_host_key_checking": {"key": "strictHostKeyChecking", "type": "bool"}, + } + + def __init__( + self, + *, + name: str, + uri: str, + pattern: Optional[List[str]] = None, + label: Optional[str] = None, + search_paths: Optional[List[str]] = None, + username: Optional[str] = None, + password: Optional[str] = None, + host_key: Optional[str] = None, + host_key_algorithm: Optional[str] = None, + private_key: Optional[str] = None, + strict_host_key_checking: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the repository. Required. + :paramtype name: str + :keyword pattern: Collection of pattern of the repository. + :paramtype pattern: list[str] + :keyword uri: URI of the repository. Required. + :paramtype uri: str + :keyword label: Label of the repository. + :paramtype label: str + :keyword search_paths: Searching path of the repository. + :paramtype search_paths: list[str] + :keyword username: Username of git repository basic auth. + :paramtype username: str + :keyword password: Password of git repository basic auth. + :paramtype password: str + :keyword host_key: Public sshKey of git repository. + :paramtype host_key: str + :keyword host_key_algorithm: SshKey algorithm of git repository. + :paramtype host_key_algorithm: str + :keyword private_key: Private sshKey algorithm of git repository. + :paramtype private_key: str + :keyword strict_host_key_checking: Strict host key checking or not. + :paramtype strict_host_key_checking: bool + """ + super().__init__(**kwargs) + self.name = name + self.pattern = pattern + self.uri = uri + self.label = label + self.search_paths = search_paths + self.username = username + self.password = password + self.host_key = host_key + self.host_key_algorithm = host_key_algorithm + self.private_key = private_key + self.strict_host_key_checking = strict_host_key_checking + + +class GloballyEnabledApms(_serialization.Model): + """Globally enabled APMs payload. + + :ivar value: Collection of the globally enabled APMs. + :vartype value: list[str] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[str]"}, + } + + def __init__(self, *, value: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword value: Collection of the globally enabled APMs. + :paramtype value: list[str] + """ + super().__init__(**kwargs) + self.value = value + + +class HTTPGetAction(ProbeAction): + """HTTPGetAction describes an action based on HTTP Get requests. + + All required parameters must be populated in order to send to server. + + :ivar type: The type of the action to take to perform the health check. Required. Known values + are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". + :vartype type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.ProbeActionType + :ivar path: Path to access on the HTTP server. + :vartype path: str + :ivar scheme: Scheme to use for connecting to the host. Defaults to HTTP. + + Possible enum values: + + + * ``"HTTP"`` means that the scheme used will be http:// + * ``"HTTPS"`` means that the scheme used will be https://. Known values are: "HTTP" and + "HTTPS". + :vartype scheme: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.HTTPSchemeType + """ + + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "scheme": {"key": "scheme", "type": "str"}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + scheme: Optional[Union[str, "_models.HTTPSchemeType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword path: Path to access on the HTTP server. + :paramtype path: str + :keyword scheme: Scheme to use for connecting to the host. Defaults to HTTP. + + Possible enum values: + + + * ``"HTTP"`` means that the scheme used will be http:// + * ``"HTTPS"`` means that the scheme used will be https://. Known values are: "HTTP" and + "HTTPS". + :paramtype scheme: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.HTTPSchemeType + """ + super().__init__(**kwargs) + self.type: str = "HTTPGetAction" + self.path = path + self.scheme = scheme + + +class HttpScaleRule(_serialization.Model): + """Azure Spring Apps App Instance Http scaling rule. + + :ivar metadata: Metadata properties to describe http scale rule. + :vartype metadata: dict[str, str] + :ivar auth: Authentication secrets for the custom scale rule. + :vartype auth: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ScaleRuleAuth] + """ + + _attribute_map = { + "metadata": {"key": "metadata", "type": "{str}"}, + "auth": {"key": "auth", "type": "[ScaleRuleAuth]"}, + } + + def __init__( + self, + *, + metadata: Optional[Dict[str, str]] = None, + auth: Optional[List["_models.ScaleRuleAuth"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword metadata: Metadata properties to describe http scale rule. + :paramtype metadata: dict[str, str] + :keyword auth: Authentication secrets for the custom scale rule. + :paramtype auth: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ScaleRuleAuth] + """ + super().__init__(**kwargs) + self.metadata = metadata + self.auth = auth + + +class ImageRegistryCredential(_serialization.Model): + """Credential of the image registry. + + :ivar username: The username of the image registry credential. + :vartype username: str + :ivar password: The password of the image registry credential. + :vartype password: str + """ + + _attribute_map = { + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + } + + def __init__(self, *, username: Optional[str] = None, password: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword username: The username of the image registry credential. + :paramtype username: str + :keyword password: The password of the image registry credential. + :paramtype password: str + """ + super().__init__(**kwargs) + self.username = username + self.password = password + + +class IngressConfig(_serialization.Model): + """Ingress configuration payload for Azure Spring Apps resource. + + :ivar read_timeout_in_seconds: Ingress read time out in seconds. + :vartype read_timeout_in_seconds: int + """ + + _attribute_map = { + "read_timeout_in_seconds": {"key": "readTimeoutInSeconds", "type": "int"}, + } + + def __init__(self, *, read_timeout_in_seconds: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword read_timeout_in_seconds: Ingress read time out in seconds. + :paramtype read_timeout_in_seconds: int + """ + super().__init__(**kwargs) + self.read_timeout_in_seconds = read_timeout_in_seconds + + +class IngressSettings(_serialization.Model): + """App ingress settings payload. + + :ivar read_timeout_in_seconds: Ingress read time out in seconds. + :vartype read_timeout_in_seconds: int + :ivar send_timeout_in_seconds: Ingress send time out in seconds. + :vartype send_timeout_in_seconds: int + :ivar session_affinity: Type of the affinity, set this to Cookie to enable session affinity. + Known values are: "Cookie" and "None". + :vartype session_affinity: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.SessionAffinity + :ivar session_cookie_max_age: Time in seconds until the cookie expires. + :vartype session_cookie_max_age: int + :ivar backend_protocol: How ingress should communicate with this app backend service. Known + values are: "GRPC" and "Default". + :vartype backend_protocol: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BackendProtocol + :ivar client_auth: Client-Certification Authentication. + :vartype client_auth: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.IngressSettingsClientAuth + """ + + _attribute_map = { + "read_timeout_in_seconds": {"key": "readTimeoutInSeconds", "type": "int"}, + "send_timeout_in_seconds": {"key": "sendTimeoutInSeconds", "type": "int"}, + "session_affinity": {"key": "sessionAffinity", "type": "str"}, + "session_cookie_max_age": {"key": "sessionCookieMaxAge", "type": "int"}, + "backend_protocol": {"key": "backendProtocol", "type": "str"}, + "client_auth": {"key": "clientAuth", "type": "IngressSettingsClientAuth"}, + } + + def __init__( + self, + *, + read_timeout_in_seconds: Optional[int] = None, + send_timeout_in_seconds: Optional[int] = None, + session_affinity: Optional[Union[str, "_models.SessionAffinity"]] = None, + session_cookie_max_age: Optional[int] = None, + backend_protocol: Optional[Union[str, "_models.BackendProtocol"]] = None, + client_auth: Optional["_models.IngressSettingsClientAuth"] = None, + **kwargs: Any + ) -> None: + """ + :keyword read_timeout_in_seconds: Ingress read time out in seconds. + :paramtype read_timeout_in_seconds: int + :keyword send_timeout_in_seconds: Ingress send time out in seconds. + :paramtype send_timeout_in_seconds: int + :keyword session_affinity: Type of the affinity, set this to Cookie to enable session affinity. + Known values are: "Cookie" and "None". + :paramtype session_affinity: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.SessionAffinity + :keyword session_cookie_max_age: Time in seconds until the cookie expires. + :paramtype session_cookie_max_age: int + :keyword backend_protocol: How ingress should communicate with this app backend service. Known + values are: "GRPC" and "Default". + :paramtype backend_protocol: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BackendProtocol + :keyword client_auth: Client-Certification Authentication. + :paramtype client_auth: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.IngressSettingsClientAuth + """ + super().__init__(**kwargs) + self.read_timeout_in_seconds = read_timeout_in_seconds + self.send_timeout_in_seconds = send_timeout_in_seconds + self.session_affinity = session_affinity + self.session_cookie_max_age = session_cookie_max_age + self.backend_protocol = backend_protocol + self.client_auth = client_auth + + +class IngressSettingsClientAuth(_serialization.Model): + """Client-Certification Authentication. + + :ivar certificates: Collection of certificate resource id. + :vartype certificates: list[str] + """ + + _attribute_map = { + "certificates": {"key": "certificates", "type": "[str]"}, + } + + def __init__(self, *, certificates: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword certificates: Collection of certificate resource id. + :paramtype certificates: list[str] + """ + super().__init__(**kwargs) + self.certificates = certificates + + +class UploadedUserSourceInfo(UserSourceInfo): + """Source with uploaded location. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + JarUploadedUserSourceInfo, NetCoreZipUploadedUserSourceInfo, SourceUploadedUserSourceInfo, + WarUploadedUserSourceInfo + + All required parameters must be populated in order to send to server. + + :ivar type: Type of the source uploaded. Required. + :vartype type: str + :ivar version: Version of the source. + :vartype version: str + :ivar relative_path: Relative path of the storage which stores the source. + :vartype relative_path: str + """ + + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "relative_path": {"key": "relativePath", "type": "str"}, + } + + _subtype_map = { + "type": { + "Jar": "JarUploadedUserSourceInfo", + "NetCoreZip": "NetCoreZipUploadedUserSourceInfo", + "Source": "SourceUploadedUserSourceInfo", + "War": "WarUploadedUserSourceInfo", + } + } + + def __init__(self, *, version: Optional[str] = None, relative_path: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword version: Version of the source. + :paramtype version: str + :keyword relative_path: Relative path of the storage which stores the source. + :paramtype relative_path: str + """ + super().__init__(version=version, **kwargs) + self.type: str = "UploadedUserSourceInfo" + self.relative_path = relative_path + + +class JarUploadedUserSourceInfo(UploadedUserSourceInfo): + """Uploaded Jar binary for a deployment. + + All required parameters must be populated in order to send to server. + + :ivar type: Type of the source uploaded. Required. + :vartype type: str + :ivar version: Version of the source. + :vartype version: str + :ivar relative_path: Relative path of the storage which stores the source. + :vartype relative_path: str + :ivar runtime_version: Runtime version of the Jar file. + :vartype runtime_version: str + :ivar jvm_options: JVM parameter. + :vartype jvm_options: str + """ + + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "relative_path": {"key": "relativePath", "type": "str"}, + "runtime_version": {"key": "runtimeVersion", "type": "str"}, + "jvm_options": {"key": "jvmOptions", "type": "str"}, + } + + def __init__( + self, + *, + version: Optional[str] = None, + relative_path: Optional[str] = None, + runtime_version: Optional[str] = None, + jvm_options: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword version: Version of the source. + :paramtype version: str + :keyword relative_path: Relative path of the storage which stores the source. + :paramtype relative_path: str + :keyword runtime_version: Runtime version of the Jar file. + :paramtype runtime_version: str + :keyword jvm_options: JVM parameter. + :paramtype jvm_options: str + """ + super().__init__(version=version, relative_path=relative_path, **kwargs) + self.type: str = "Jar" + self.runtime_version = runtime_version + self.jvm_options = jvm_options + + +class JobExecution(_serialization.Model): + """Azure Spring Apps Job execution. + + :ivar name: Job execution Name. + :vartype name: str + :ivar status: Current state of the job execution. Known values are: "Running", "Pending", + "Canceled", "Failed", and "Completed". + :vartype status: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecutionRunningState + :ivar start_time: Job execution start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: Job execution end time. + :vartype end_time: ~datetime.datetime + :ivar template: The template which is applied for the execution of the Job. + :vartype template: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecutionTemplate + :ivar job_snapshot: The snapshot of job configuration. + :vartype job_snapshot: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResourceProperties + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "template": {"key": "template", "type": "JobExecutionTemplate"}, + "job_snapshot": {"key": "jobSnapshot", "type": "JobResourceProperties"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + status: Optional[Union[str, "_models.JobExecutionRunningState"]] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + template: Optional["_models.JobExecutionTemplate"] = None, + job_snapshot: Optional["_models.JobResourceProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Job execution Name. + :paramtype name: str + :keyword status: Current state of the job execution. Known values are: "Running", "Pending", + "Canceled", "Failed", and "Completed". + :paramtype status: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecutionRunningState + :keyword start_time: Job execution start time. + :paramtype start_time: ~datetime.datetime + :keyword end_time: Job execution end time. + :paramtype end_time: ~datetime.datetime + :keyword template: The template which is applied for the execution of the Job. + :paramtype template: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecutionTemplate + :keyword job_snapshot: The snapshot of job configuration. + :paramtype job_snapshot: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResourceProperties + """ + super().__init__(**kwargs) + self.name = name + self.status = status + self.start_time = start_time + self.end_time = end_time + self.template = template + self.job_snapshot = job_snapshot + + +class JobExecutionCollection(_serialization.Model): + """Azure Spring App Job executions collection. + + All required parameters must be populated in order to send to server. + + :ivar value: Collection of Job executions. Required. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecution] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[JobExecution]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.JobExecution"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: Collection of Job executions. Required. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecution] + :keyword next_link: Link to next page of resources. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class JobExecutionTemplate(_serialization.Model): + """Job's execution template, containing configuration for an execution. + + :ivar environment_variables: Environment variables of Job execution. + :vartype environment_variables: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.EnvVar] + :ivar args: Arguments for the Job execution. + :vartype args: list[str] + :ivar resource_requests: The requested resource quantity for required CPU and Memory. + :vartype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResourceRequests + """ + + _attribute_map = { + "environment_variables": {"key": "environmentVariables", "type": "[EnvVar]"}, + "args": {"key": "args", "type": "[str]"}, + "resource_requests": {"key": "resourceRequests", "type": "JobResourceRequests"}, + } + + def __init__( + self, + *, + environment_variables: Optional[List["_models.EnvVar"]] = None, + args: Optional[List[str]] = None, + resource_requests: Optional["_models.JobResourceRequests"] = None, + **kwargs: Any + ) -> None: + """ + :keyword environment_variables: Environment variables of Job execution. + :paramtype environment_variables: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.EnvVar] + :keyword args: Arguments for the Job execution. + :paramtype args: list[str] + :keyword resource_requests: The requested resource quantity for required CPU and Memory. + :paramtype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResourceRequests + """ + super().__init__(**kwargs) + self.environment_variables = environment_variables + self.args = args + self.resource_requests = resource_requests + + +class JobResource(ProxyResource): + """Job resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of the Job resource. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResourceProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobResourceProperties"}, + } + + def __init__(self, *, properties: Optional["_models.JobResourceProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of the Job resource. + :paramtype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResourceProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class JobResourceCollection(_serialization.Model): + """List of Azure Spring Apps Jobs and a possible link for next set. + + :ivar value: Collection of Job resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[JobResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.JobResource"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Job resources. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource] + :keyword next_link: Link to next page of resources. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class JobResourceProperties(_serialization.Model): + """Job resource properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: Provisioning state of the Job. Known values are: "Succeeded", + "Failed", "Creating", "Updating", "Deleting", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResourceProvisioningState + :ivar template: The template which is applied for all executions of the Job. + :vartype template: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecutionTemplate + :ivar source: Uploaded source information of the Job. + :vartype source: ~azure.mgmt.appplatform.v2024_05_01_preview.models.UserSourceInfo + :ivar managed_component_references: Referenced managed components collection. + :vartype managed_component_references: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ManagedComponentReference] + :ivar trigger_config: The Job trigger related configuration. + :vartype trigger_config: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobTriggerConfig + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "template": {"key": "template", "type": "JobExecutionTemplate"}, + "source": {"key": "source", "type": "UserSourceInfo"}, + "managed_component_references": {"key": "managedComponentReferences", "type": "[ManagedComponentReference]"}, + "trigger_config": {"key": "triggerConfig", "type": "JobTriggerConfig"}, + } + + def __init__( + self, + *, + template: Optional["_models.JobExecutionTemplate"] = None, + source: Optional["_models.UserSourceInfo"] = None, + managed_component_references: Optional[List["_models.ManagedComponentReference"]] = None, + trigger_config: Optional["_models.JobTriggerConfig"] = None, + **kwargs: Any + ) -> None: + """ + :keyword template: The template which is applied for all executions of the Job. + :paramtype template: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecutionTemplate + :keyword source: Uploaded source information of the Job. + :paramtype source: ~azure.mgmt.appplatform.v2024_05_01_preview.models.UserSourceInfo + :keyword managed_component_references: Referenced managed components collection. + :paramtype managed_component_references: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ManagedComponentReference] + :keyword trigger_config: The Job trigger related configuration. + :paramtype trigger_config: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobTriggerConfig + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.template = template + self.source = source + self.managed_component_references = managed_component_references + self.trigger_config = trigger_config + + +class JobResourceRequests(_serialization.Model): + """Job resource request payload. + + :ivar cpu: CPU allocated to each job execution instance. + :vartype cpu: str + :ivar memory: Memory allocated to each job execution instance. + :vartype memory: str + """ + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + } + + def __init__(self, *, cpu: str = "1", memory: str = "2Gi", **kwargs: Any) -> None: + """ + :keyword cpu: CPU allocated to each job execution instance. + :paramtype cpu: str + :keyword memory: Memory allocated to each job execution instance. + :paramtype memory: str + """ + super().__init__(**kwargs) + self.cpu = cpu + self.memory = memory + + +class JobTriggerConfig(_serialization.Model): + """Configuration for different trigger types. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ManualJobTriggerConfig + + All required parameters must be populated in order to send to server. + + :ivar trigger_type: Type of job trigger. "Manual" + :vartype trigger_type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.TriggerType + """ + + _validation = { + "trigger_type": {"required": True}, + } + + _attribute_map = { + "trigger_type": {"key": "triggerType", "type": "str"}, + } + + _subtype_map = {"trigger_type": {"Manual": "ManualJobTriggerConfig"}} + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.trigger_type: Optional[str] = None + + +class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=too-many-instance-attributes + """Properties of certificate imported from key 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 server. + + :ivar type: The type of the certificate source. Required. + :vartype type: str + :ivar thumbprint: The thumbprint of certificate. + :vartype thumbprint: str + :ivar issuer: The issuer of certificate. + :vartype issuer: str + :ivar issued_date: The issue date of certificate. + :vartype issued_date: str + :ivar expiration_date: The expiration date of certificate. + :vartype expiration_date: str + :ivar activate_date: The activate date of certificate. + :vartype activate_date: str + :ivar subject_name: The subject name of certificate. + :vartype subject_name: str + :ivar dns_names: The domain list of certificate. + :vartype dns_names: list[str] + :ivar provisioning_state: Provisioning state of the Certificate. Known values are: "Creating", + "Updating", "Succeeded", "Failed", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResourceProvisioningState + :ivar vault_uri: The vault uri of user key vault. Required. + :vartype vault_uri: str + :ivar key_vault_cert_name: The certificate name of key vault. Required. + :vartype key_vault_cert_name: str + :ivar cert_version: The certificate version of key vault. + :vartype cert_version: str + :ivar exclude_private_key: Optional. If set to true, it will not import private key from key + vault. + :vartype exclude_private_key: bool + :ivar auto_sync: Indicates whether to automatically synchronize certificate from key vault or + not. Known values are: "Disabled" and "Enabled". + :vartype auto_sync: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.KeyVaultCertificateAutoSync + """ + + _validation = { + "type": {"required": True}, + "thumbprint": {"readonly": True}, + "issuer": {"readonly": True}, + "issued_date": {"readonly": True}, + "expiration_date": {"readonly": True}, + "activate_date": {"readonly": True}, + "subject_name": {"readonly": True}, + "dns_names": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "vault_uri": {"required": True}, + "key_vault_cert_name": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, + "issuer": {"key": "issuer", "type": "str"}, + "issued_date": {"key": "issuedDate", "type": "str"}, + "expiration_date": {"key": "expirationDate", "type": "str"}, + "activate_date": {"key": "activateDate", "type": "str"}, + "subject_name": {"key": "subjectName", "type": "str"}, + "dns_names": {"key": "dnsNames", "type": "[str]"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "vault_uri": {"key": "vaultUri", "type": "str"}, + "key_vault_cert_name": {"key": "keyVaultCertName", "type": "str"}, + "cert_version": {"key": "certVersion", "type": "str"}, + "exclude_private_key": {"key": "excludePrivateKey", "type": "bool"}, + "auto_sync": {"key": "autoSync", "type": "str"}, + } + + def __init__( + self, + *, + vault_uri: str, + key_vault_cert_name: str, + cert_version: Optional[str] = None, + exclude_private_key: bool = False, + auto_sync: Union[str, "_models.KeyVaultCertificateAutoSync"] = "Disabled", + **kwargs: Any + ) -> None: + """ + :keyword vault_uri: The vault uri of user key vault. Required. + :paramtype vault_uri: str + :keyword key_vault_cert_name: The certificate name of key vault. Required. + :paramtype key_vault_cert_name: str + :keyword cert_version: The certificate version of key vault. + :paramtype cert_version: str + :keyword exclude_private_key: Optional. If set to true, it will not import private key from key + vault. + :paramtype exclude_private_key: bool + :keyword auto_sync: Indicates whether to automatically synchronize certificate from key vault + or not. Known values are: "Disabled" and "Enabled". + :paramtype auto_sync: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.KeyVaultCertificateAutoSync + """ + super().__init__(**kwargs) + self.type: str = "KeyVaultCertificate" + self.vault_uri = vault_uri + self.key_vault_cert_name = key_vault_cert_name + self.cert_version = cert_version + self.exclude_private_key = exclude_private_key + self.auto_sync = auto_sync + + +class LoadedCertificate(_serialization.Model): + """Loaded certificate payload. + + All required parameters must be populated in order to send to server. + + :ivar resource_id: Resource Id of loaded certificate. Required. + :vartype resource_id: str + :ivar load_trust_store: Indicate whether the certificate will be loaded into default trust + store, only work for Java runtime. + :vartype load_trust_store: bool + """ + + _validation = { + "resource_id": {"required": True}, + } + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + "load_trust_store": {"key": "loadTrustStore", "type": "bool"}, + } + + def __init__(self, *, resource_id: str, load_trust_store: bool = False, **kwargs: Any) -> None: + """ + :keyword resource_id: Resource Id of loaded certificate. Required. + :paramtype resource_id: str + :keyword load_trust_store: Indicate whether the certificate will be loaded into default trust + store, only work for Java runtime. + :paramtype load_trust_store: bool + """ + super().__init__(**kwargs) + self.resource_id = resource_id + self.load_trust_store = load_trust_store + + +class LogFileUrlResponse(_serialization.Model): + """Log file URL payload. + + All required parameters must be populated in order to send to server. + + :ivar url: URL of the log file. Required. + :vartype url: str + """ + + _validation = { + "url": {"required": True}, + } + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + } + + def __init__(self, *, url: str, **kwargs: Any) -> None: + """ + :keyword url: URL of the log file. Required. + :paramtype url: str + """ + super().__init__(**kwargs) + self.url = url + + +class LogSpecification(_serialization.Model): + """Specifications of the Log for Azure Monitoring. + + :ivar name: Name of the log. + :vartype name: str + :ivar display_name: Localized friendly display name of the log. + :vartype display_name: str + :ivar blob_duration: Blob duration of the log. + :vartype blob_duration: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "blob_duration": {"key": "blobDuration", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + blob_duration: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the log. + :paramtype name: str + :keyword display_name: Localized friendly display name of the log. + :paramtype display_name: str + :keyword blob_duration: Blob duration of the log. + :paramtype blob_duration: str + """ + super().__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration + + +class MaintenanceScheduleConfiguration(_serialization.Model): + """Configuration for the planned maintenance. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + WeeklyMaintenanceScheduleConfiguration + + All required parameters must be populated in order to send to server. + + :ivar frequency: The frequency to run the maintenance job. Required. "Weekly" + :vartype frequency: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.Frequency + """ + + _validation = { + "frequency": {"required": True}, + } + + _attribute_map = { + "frequency": {"key": "frequency", "type": "str"}, + } + + _subtype_map = {"frequency": {"Weekly": "WeeklyMaintenanceScheduleConfiguration"}} + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.frequency: Optional[str] = None + + +class ManagedComponentReference(_serialization.Model): + """A reference to the managed component like Config Server. + + All required parameters must be populated in order to send to server. + + :ivar resource_id: Resource Id of the managed component. Required. + :vartype resource_id: str + """ + + _validation = { + "resource_id": {"required": True}, + } + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + } + + def __init__(self, *, resource_id: str, **kwargs: Any) -> None: + """ + :keyword resource_id: Resource Id of the managed component. Required. + :paramtype resource_id: str + """ + super().__init__(**kwargs) + self.resource_id = resource_id + + +class ManagedIdentityProperties(_serialization.Model): + """Managed identity properties retrieved from ARM request headers. + + :ivar type: Type of the managed identity. Known values are: "None", "SystemAssigned", + "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.ManagedIdentityType + :ivar principal_id: Principal Id of system-assigned managed identity. + :vartype principal_id: str + :ivar tenant_id: Tenant Id of system-assigned managed identity. + :vartype tenant_id: str + :ivar user_assigned_identities: Properties of user-assigned managed identities. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.appplatform.v2024_05_01_preview.models.UserAssignedManagedIdentity] + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedManagedIdentity}"}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "_models.ManagedIdentityType"]] = None, + principal_id: Optional[str] = None, + tenant_id: Optional[str] = None, + user_assigned_identities: Optional[Dict[str, "_models.UserAssignedManagedIdentity"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: Type of the managed identity. Known values are: "None", "SystemAssigned", + "UserAssigned", and "SystemAssigned,UserAssigned". + :paramtype type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.ManagedIdentityType + :keyword principal_id: Principal Id of system-assigned managed identity. + :paramtype principal_id: str + :keyword tenant_id: Tenant Id of system-assigned managed identity. + :paramtype tenant_id: str + :keyword user_assigned_identities: Properties of user-assigned managed identities. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.appplatform.v2024_05_01_preview.models.UserAssignedManagedIdentity] + """ + super().__init__(**kwargs) + self.type = type + self.principal_id = principal_id + self.tenant_id = tenant_id + self.user_assigned_identities = user_assigned_identities + + +class ManualJobTriggerConfig(JobTriggerConfig): + """Configuration for manual triggered job. + + All required parameters must be populated in order to send to server. + + :ivar trigger_type: Type of job trigger. "Manual" + :vartype trigger_type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.TriggerType + :ivar parallelism: Number of parallel replicas of a job execution can run. + :vartype parallelism: int + :ivar timeout_in_seconds: Maximum number of seconds an execution is allowed to run. + :vartype timeout_in_seconds: int + :ivar retry_limit: Maximum number of retries before failing the job. + :vartype retry_limit: int + """ + + _validation = { + "trigger_type": {"required": True}, + } + + _attribute_map = { + "trigger_type": {"key": "triggerType", "type": "str"}, + "parallelism": {"key": "parallelism", "type": "int"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "retry_limit": {"key": "retryLimit", "type": "int"}, + } + + def __init__( + self, + *, + parallelism: Optional[int] = None, + timeout_in_seconds: Optional[int] = None, + retry_limit: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword parallelism: Number of parallel replicas of a job execution can run. + :paramtype parallelism: int + :keyword timeout_in_seconds: Maximum number of seconds an execution is allowed to run. + :paramtype timeout_in_seconds: int + :keyword retry_limit: Maximum number of retries before failing the job. + :paramtype retry_limit: int + """ + super().__init__(**kwargs) + self.trigger_type: str = "Manual" + self.parallelism = parallelism + self.timeout_in_seconds = timeout_in_seconds + self.retry_limit = retry_limit + + +class MarketplaceResource(_serialization.Model): + """Purchasing 3rd Party product for one Azure Spring Apps instance. + + :ivar plan: The plan id of the 3rd Party Artifact that is being procured. + :vartype plan: str + :ivar publisher: The publisher id of the 3rd Party Artifact that is being bought. + :vartype publisher: str + :ivar product: The 3rd Party artifact that is being procured. + :vartype product: str + """ + + _attribute_map = { + "plan": {"key": "plan", "type": "str"}, + "publisher": {"key": "publisher", "type": "str"}, + "product": {"key": "product", "type": "str"}, + } + + def __init__( + self, + *, + plan: Optional[str] = None, + publisher: Optional[str] = None, + product: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword plan: The plan id of the 3rd Party Artifact that is being procured. + :paramtype plan: str + :keyword publisher: The publisher id of the 3rd Party Artifact that is being bought. + :paramtype publisher: str + :keyword product: The 3rd Party artifact that is being procured. + :paramtype product: str + """ + super().__init__(**kwargs) + self.plan = plan + self.publisher = publisher + self.product = product + + +class MetricDimension(_serialization.Model): + """Specifications of the Dimension of metrics. + + :ivar name: Name of the dimension. + :vartype name: str + :ivar display_name: Localized friendly display name of the dimension. + :vartype display_name: str + :ivar to_be_exported_for_shoebox: Whether this dimension should be included for the Shoebox + export scenario. + :vartype to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "to_be_exported_for_shoebox": {"key": "toBeExportedForShoebox", "type": "bool"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + to_be_exported_for_shoebox: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the dimension. + :paramtype name: str + :keyword display_name: Localized friendly display name of the dimension. + :paramtype display_name: str + :keyword to_be_exported_for_shoebox: Whether this dimension should be included for the Shoebox + export scenario. + :paramtype to_be_exported_for_shoebox: bool + """ + super().__init__(**kwargs) + self.name = name + self.display_name = display_name + self.to_be_exported_for_shoebox = to_be_exported_for_shoebox + + +class MetricSpecification(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Specifications of the Metrics for Azure Monitoring. + + :ivar name: Name of the metric. + :vartype name: str + :ivar display_name: Localized friendly display name of the metric. + :vartype display_name: str + :ivar display_description: Localized friendly description of the metric. + :vartype display_description: str + :ivar unit: Unit that makes sense for the metric. + :vartype unit: str + :ivar category: Name of the metric category that the metric belongs to. A metric can only + belong to a single category. + :vartype category: str + :ivar aggregation_type: Only provide one value for this field. Valid values: Average, Minimum, + Maximum, Total, Count. + :vartype aggregation_type: str + :ivar supported_aggregation_types: Supported aggregation types. + :vartype supported_aggregation_types: list[str] + :ivar supported_time_grain_types: Supported time grain types. + :vartype supported_time_grain_types: list[str] + :ivar fill_gap_with_zero: Optional. If set to true, then zero will be returned for time + duration where no metric is emitted/published. + :vartype fill_gap_with_zero: bool + :ivar dimensions: Dimensions of the metric. + :vartype dimensions: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.MetricDimension] + :ivar source_mdm_namespace: Name of the MDM namespace. Optional. + :vartype source_mdm_namespace: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "display_description": {"key": "displayDescription", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "aggregation_type": {"key": "aggregationType", "type": "str"}, + "supported_aggregation_types": {"key": "supportedAggregationTypes", "type": "[str]"}, + "supported_time_grain_types": {"key": "supportedTimeGrainTypes", "type": "[str]"}, + "fill_gap_with_zero": {"key": "fillGapWithZero", "type": "bool"}, + "dimensions": {"key": "dimensions", "type": "[MetricDimension]"}, + "source_mdm_namespace": {"key": "sourceMdmNamespace", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[str] = None, + category: Optional[str] = None, + aggregation_type: Optional[str] = None, + supported_aggregation_types: Optional[List[str]] = None, + supported_time_grain_types: Optional[List[str]] = None, + fill_gap_with_zero: Optional[bool] = None, + dimensions: Optional[List["_models.MetricDimension"]] = None, + source_mdm_namespace: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the metric. + :paramtype name: str + :keyword display_name: Localized friendly display name of the metric. + :paramtype display_name: str + :keyword display_description: Localized friendly description of the metric. + :paramtype display_description: str + :keyword unit: Unit that makes sense for the metric. + :paramtype unit: str + :keyword category: Name of the metric category that the metric belongs to. A metric can only + belong to a single category. + :paramtype category: str + :keyword aggregation_type: Only provide one value for this field. Valid values: Average, + Minimum, Maximum, Total, Count. + :paramtype aggregation_type: str + :keyword supported_aggregation_types: Supported aggregation types. + :paramtype supported_aggregation_types: list[str] + :keyword supported_time_grain_types: Supported time grain types. + :paramtype supported_time_grain_types: list[str] + :keyword fill_gap_with_zero: Optional. If set to true, then zero will be returned for time + duration where no metric is emitted/published. + :paramtype fill_gap_with_zero: bool + :keyword dimensions: Dimensions of the metric. + :paramtype dimensions: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.MetricDimension] + :keyword source_mdm_namespace: Name of the MDM namespace. Optional. + :paramtype source_mdm_namespace: str + """ + super().__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.category = category + self.aggregation_type = aggregation_type + self.supported_aggregation_types = supported_aggregation_types + self.supported_time_grain_types = supported_time_grain_types + self.fill_gap_with_zero = fill_gap_with_zero + self.dimensions = dimensions + self.source_mdm_namespace = source_mdm_namespace + + +class MonitoringSettingProperties(_serialization.Model): + """Monitoring Setting properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: State of the Monitoring Setting. Known values are: "NotAvailable", + "Failed", "Succeeded", and "Updating". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingState + :ivar error: Error when apply Monitoring Setting changes. + :vartype error: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Error + :ivar trace_enabled: Indicates whether enable the trace functionality, which will be deprecated + since api version 2020-11-01-preview. Please leverage appInsightsInstrumentationKey to indicate + if monitoringSettings enabled or not. + :vartype trace_enabled: bool + :ivar app_insights_instrumentation_key: Target application insight instrumentation key, null or + whitespace include empty will disable monitoringSettings. + :vartype app_insights_instrumentation_key: str + :ivar app_insights_sampling_rate: Indicates the sampling rate of application insight agent, + should be in range [0.0, 100.0]. + :vartype app_insights_sampling_rate: float + :ivar app_insights_agent_versions: Indicates the versions of application insight agent. + :vartype app_insights_agent_versions: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationInsightsAgentVersions + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "app_insights_sampling_rate": {"maximum": 100, "minimum": 0}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "error": {"key": "error", "type": "Error"}, + "trace_enabled": {"key": "traceEnabled", "type": "bool"}, + "app_insights_instrumentation_key": {"key": "appInsightsInstrumentationKey", "type": "str"}, + "app_insights_sampling_rate": {"key": "appInsightsSamplingRate", "type": "float"}, + "app_insights_agent_versions": {"key": "appInsightsAgentVersions", "type": "ApplicationInsightsAgentVersions"}, + } + + def __init__( + self, + *, + error: Optional["_models.Error"] = None, + trace_enabled: Optional[bool] = None, + app_insights_instrumentation_key: Optional[str] = None, + app_insights_sampling_rate: Optional[float] = None, + app_insights_agent_versions: Optional["_models.ApplicationInsightsAgentVersions"] = None, + **kwargs: Any + ) -> None: + """ + :keyword error: Error when apply Monitoring Setting changes. + :paramtype error: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Error + :keyword trace_enabled: Indicates whether enable the trace functionality, which will be + deprecated since api version 2020-11-01-preview. Please leverage appInsightsInstrumentationKey + to indicate if monitoringSettings enabled or not. + :paramtype trace_enabled: bool + :keyword app_insights_instrumentation_key: Target application insight instrumentation key, null + or whitespace include empty will disable monitoringSettings. + :paramtype app_insights_instrumentation_key: str + :keyword app_insights_sampling_rate: Indicates the sampling rate of application insight agent, + should be in range [0.0, 100.0]. + :paramtype app_insights_sampling_rate: float + :keyword app_insights_agent_versions: Indicates the versions of application insight agent. + :paramtype app_insights_agent_versions: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationInsightsAgentVersions + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.error = error + self.trace_enabled = trace_enabled + self.app_insights_instrumentation_key = app_insights_instrumentation_key + self.app_insights_sampling_rate = app_insights_sampling_rate + self.app_insights_agent_versions = app_insights_agent_versions + + +class MonitoringSettingResource(ProxyResource): + """Monitoring Setting resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of the Monitoring Setting resource. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "MonitoringSettingProperties"}, + } + + def __init__(self, *, properties: Optional["_models.MonitoringSettingProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of the Monitoring Setting resource. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class NameAvailability(_serialization.Model): + """Name availability result payload. + + :ivar name_available: Indicates whether the name is available. + :vartype name_available: bool + :ivar reason: Reason why the name is not available. + :vartype reason: str + :ivar message: Message why the name is not available. + :vartype message: str + """ + + _attribute_map = { + "name_available": {"key": "nameAvailable", "type": "bool"}, + "reason": {"key": "reason", "type": "str"}, + "message": {"key": "message", "type": "str"}, + } + + def __init__( + self, + *, + name_available: Optional[bool] = None, + reason: Optional[str] = None, + message: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name_available: Indicates whether the name is available. + :paramtype name_available: bool + :keyword reason: Reason why the name is not available. + :paramtype reason: str + :keyword message: Message why the name is not available. + :paramtype message: str + """ + super().__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message + + +class NameAvailabilityParameters(_serialization.Model): + """Name availability parameters payload. + + All required parameters must be populated in order to send to server. + + :ivar type: Type of the resource to check name availability. Required. + :vartype type: str + :ivar name: Name to be checked. Required. + :vartype name: str + """ + + _validation = { + "type": {"required": True}, + "name": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, *, type: str, name: str, **kwargs: Any) -> None: + """ + :keyword type: Type of the resource to check name availability. Required. + :paramtype type: str + :keyword name: Name to be checked. Required. + :paramtype name: str + """ + super().__init__(**kwargs) + self.type = type + self.name = name + + +class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): + """Uploaded Jar binary for a deployment. + + All required parameters must be populated in order to send to server. + + :ivar type: Type of the source uploaded. Required. + :vartype type: str + :ivar version: Version of the source. + :vartype version: str + :ivar relative_path: Relative path of the storage which stores the source. + :vartype relative_path: str + :ivar net_core_main_entry_path: The path to the .NET executable relative to zip root. + :vartype net_core_main_entry_path: str + :ivar runtime_version: Runtime version of the .Net file. + :vartype runtime_version: str + """ + + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "relative_path": {"key": "relativePath", "type": "str"}, + "net_core_main_entry_path": {"key": "netCoreMainEntryPath", "type": "str"}, + "runtime_version": {"key": "runtimeVersion", "type": "str"}, + } + + def __init__( + self, + *, + version: Optional[str] = None, + relative_path: Optional[str] = None, + net_core_main_entry_path: Optional[str] = None, + runtime_version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword version: Version of the source. + :paramtype version: str + :keyword relative_path: Relative path of the storage which stores the source. + :paramtype relative_path: str + :keyword net_core_main_entry_path: The path to the .NET executable relative to zip root. + :paramtype net_core_main_entry_path: str + :keyword runtime_version: Runtime version of the .Net file. + :paramtype runtime_version: str + """ + super().__init__(version=version, relative_path=relative_path, **kwargs) + self.type: str = "NetCoreZip" + self.net_core_main_entry_path = net_core_main_entry_path + self.runtime_version = runtime_version + + +class NetworkProfile(_serialization.Model): + """Service network profile payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar service_runtime_subnet_id: Fully qualified resource Id of the subnet to host Azure Spring + Apps Service Runtime. + :vartype service_runtime_subnet_id: str + :ivar app_subnet_id: Fully qualified resource Id of the subnet to host customer apps in Azure + Spring Apps. + :vartype app_subnet_id: str + :ivar service_cidr: Azure Spring Apps service reserved CIDR. + :vartype service_cidr: str + :ivar service_runtime_network_resource_group: Name of the resource group containing network + resources of Azure Spring Apps Service Runtime. + :vartype service_runtime_network_resource_group: str + :ivar app_network_resource_group: Name of the resource group containing network resources for + customer apps in Azure Spring Apps. + :vartype app_network_resource_group: str + :ivar outbound_i_ps: Desired outbound IP resources for Azure Spring Apps resource. + :vartype outbound_i_ps: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.NetworkProfileOutboundIPs + :ivar required_traffics: Required inbound or outbound traffics for Azure Spring Apps resource. + :vartype required_traffics: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.RequiredTraffic] + :ivar ingress_config: Ingress configuration payload for Azure Spring Apps resource. + :vartype ingress_config: ~azure.mgmt.appplatform.v2024_05_01_preview.models.IngressConfig + :ivar outbound_type: The egress traffic type of Azure Spring Apps VNet instances. + :vartype outbound_type: str + """ + + _validation = { + "outbound_i_ps": {"readonly": True}, + "required_traffics": {"readonly": True}, + } + + _attribute_map = { + "service_runtime_subnet_id": {"key": "serviceRuntimeSubnetId", "type": "str"}, + "app_subnet_id": {"key": "appSubnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "service_runtime_network_resource_group": {"key": "serviceRuntimeNetworkResourceGroup", "type": "str"}, + "app_network_resource_group": {"key": "appNetworkResourceGroup", "type": "str"}, + "outbound_i_ps": {"key": "outboundIPs", "type": "NetworkProfileOutboundIPs"}, + "required_traffics": {"key": "requiredTraffics", "type": "[RequiredTraffic]"}, + "ingress_config": {"key": "ingressConfig", "type": "IngressConfig"}, + "outbound_type": {"key": "outboundType", "type": "str"}, + } + + def __init__( + self, + *, + service_runtime_subnet_id: Optional[str] = None, + app_subnet_id: Optional[str] = None, + service_cidr: Optional[str] = None, + service_runtime_network_resource_group: Optional[str] = None, + app_network_resource_group: Optional[str] = None, + ingress_config: Optional["_models.IngressConfig"] = None, + outbound_type: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword service_runtime_subnet_id: Fully qualified resource Id of the subnet to host Azure + Spring Apps Service Runtime. + :paramtype service_runtime_subnet_id: str + :keyword app_subnet_id: Fully qualified resource Id of the subnet to host customer apps in + Azure Spring Apps. + :paramtype app_subnet_id: str + :keyword service_cidr: Azure Spring Apps service reserved CIDR. + :paramtype service_cidr: str + :keyword service_runtime_network_resource_group: Name of the resource group containing network + resources of Azure Spring Apps Service Runtime. + :paramtype service_runtime_network_resource_group: str + :keyword app_network_resource_group: Name of the resource group containing network resources + for customer apps in Azure Spring Apps. + :paramtype app_network_resource_group: str + :keyword ingress_config: Ingress configuration payload for Azure Spring Apps resource. + :paramtype ingress_config: ~azure.mgmt.appplatform.v2024_05_01_preview.models.IngressConfig + :keyword outbound_type: The egress traffic type of Azure Spring Apps VNet instances. + :paramtype outbound_type: str + """ + super().__init__(**kwargs) + self.service_runtime_subnet_id = service_runtime_subnet_id + self.app_subnet_id = app_subnet_id + self.service_cidr = service_cidr + self.service_runtime_network_resource_group = service_runtime_network_resource_group + self.app_network_resource_group = app_network_resource_group + self.outbound_i_ps = None + self.required_traffics = None + self.ingress_config = ingress_config + self.outbound_type = outbound_type + + +class NetworkProfileOutboundIPs(_serialization.Model): + """Desired outbound IP resources for Azure Spring Apps resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar public_i_ps: A list of public IP addresses. + :vartype public_i_ps: list[str] + """ + + _validation = { + "public_i_ps": {"readonly": True}, + } + + _attribute_map = { + "public_i_ps": {"key": "publicIPs", "type": "[str]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.public_i_ps = None + + +class OperationDetail(_serialization.Model): + """Operation detail payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the operation. + :vartype name: str + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool + :ivar display: Display of the operation. + :vartype display: ~azure.mgmt.appplatform.v2024_05_01_preview.models.OperationDisplay + :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for + internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.ActionType + :ivar origin: Origin of the operation. + :vartype origin: str + :ivar properties: Properties of the operation. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.OperationProperties + """ + + _validation = { + "action_type": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, + "display": {"key": "display", "type": "OperationDisplay"}, + "action_type": {"key": "actionType", "type": "str"}, + "origin": {"key": "origin", "type": "str"}, + "properties": {"key": "properties", "type": "OperationProperties"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + is_data_action: Optional[bool] = None, + display: Optional["_models.OperationDisplay"] = None, + origin: Optional[str] = None, + properties: Optional["_models.OperationProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the operation. + :paramtype name: str + :keyword is_data_action: Indicates whether the operation is a data action. + :paramtype is_data_action: bool + :keyword display: Display of the operation. + :paramtype display: ~azure.mgmt.appplatform.v2024_05_01_preview.models.OperationDisplay + :keyword origin: Origin of the operation. + :paramtype origin: str + :keyword properties: Properties of the operation. + :paramtype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.OperationProperties + """ + super().__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + self.action_type = None + self.origin = origin + self.properties = properties + + +class OperationDisplay(_serialization.Model): + """Operation display payload. + + :ivar provider: Resource provider of the operation. + :vartype provider: str + :ivar resource: Resource of the operation. + :vartype resource: str + :ivar operation: Localized friendly name for the operation. + :vartype operation: str + :ivar description: Localized friendly description for the operation. + :vartype description: str + """ + + _attribute_map = { + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword provider: Resource provider of the operation. + :paramtype provider: str + :keyword resource: Resource of the operation. + :paramtype resource: str + :keyword operation: Localized friendly name for the operation. + :paramtype operation: str + :keyword description: Localized friendly description for the operation. + :paramtype description: str + """ + super().__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationProperties(_serialization.Model): + """Extra Operation properties. + + :ivar service_specification: Service specifications of the operation. + :vartype service_specification: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceSpecification + """ + + _attribute_map = { + "service_specification": {"key": "serviceSpecification", "type": "ServiceSpecification"}, + } + + def __init__( + self, *, service_specification: Optional["_models.ServiceSpecification"] = None, **kwargs: Any + ) -> None: + """ + :keyword service_specification: Service specifications of the operation. + :paramtype service_specification: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceSpecification + """ + super().__init__(**kwargs) + self.service_specification = service_specification + + +class PersistentDisk(_serialization.Model): + """Persistent disk payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar size_in_gb: Size of the persistent disk in GB. + :vartype size_in_gb: int + :ivar used_in_gb: Size of the used persistent disk in GB. + :vartype used_in_gb: int + :ivar mount_path: Mount path of the persistent disk. + :vartype mount_path: str + """ + + _validation = { + "size_in_gb": {"maximum": 50, "minimum": 0}, + "used_in_gb": {"readonly": True, "maximum": 50, "minimum": 0}, + } + + _attribute_map = { + "size_in_gb": {"key": "sizeInGB", "type": "int"}, + "used_in_gb": {"key": "usedInGB", "type": "int"}, + "mount_path": {"key": "mountPath", "type": "str"}, + } + + def __init__(self, *, size_in_gb: Optional[int] = None, mount_path: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword size_in_gb: Size of the persistent disk in GB. + :paramtype size_in_gb: int + :keyword mount_path: Mount path of the persistent disk. + :paramtype mount_path: str + """ + super().__init__(**kwargs) + self.size_in_gb = size_in_gb + self.used_in_gb = None + self.mount_path = mount_path + + +class PredefinedAcceleratorProperties(_serialization.Model): + """Predefined accelerator properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: Provisioning state of the predefined accelerator. Known values are: + "Creating", "Updating", "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.PredefinedAcceleratorProvisioningState + :ivar display_name: + :vartype display_name: str + :ivar description: + :vartype description: str + :ivar icon_url: + :vartype icon_url: str + :ivar accelerator_tags: + :vartype accelerator_tags: list[str] + :ivar state: State of the predefined accelerator. Known values are: "Enabled" and "Disabled". + :vartype state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.PredefinedAcceleratorState + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "icon_url": {"readonly": True}, + "accelerator_tags": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "icon_url": {"key": "iconUrl", "type": "str"}, + "accelerator_tags": {"key": "acceleratorTags", "type": "[str]"}, + "state": {"key": "state", "type": "str"}, + } + + def __init__(self, *, state: Union[str, "_models.PredefinedAcceleratorState"] = "Enabled", **kwargs: Any) -> None: + """ + :keyword state: State of the predefined accelerator. Known values are: "Enabled" and + "Disabled". + :paramtype state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.PredefinedAcceleratorState + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.display_name = None + self.description = None + self.icon_url = None + self.accelerator_tags = None + self.state = state + + +class PredefinedAcceleratorResource(ProxyResource): + """Predefined accelerator resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Predefined accelerator properties payload. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.PredefinedAcceleratorProperties + :ivar sku: Sku of the predefined accelerator resource. + :vartype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "PredefinedAcceleratorProperties"}, + "sku": {"key": "sku", "type": "Sku"}, + } + + def __init__( + self, + *, + properties: Optional["_models.PredefinedAcceleratorProperties"] = None, + sku: Optional["_models.Sku"] = None, + **kwargs: Any + ) -> None: + """ + :keyword properties: Predefined accelerator properties payload. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.PredefinedAcceleratorProperties + :keyword sku: Sku of the predefined accelerator resource. + :paramtype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + super().__init__(**kwargs) + self.properties = properties + self.sku = sku + + +class PredefinedAcceleratorResourceCollection(_serialization.Model): + """PredefinedAcceleratorResourceCollection. + + :ivar value: + :vartype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.PredefinedAcceleratorResource] + :ivar next_link: + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[PredefinedAcceleratorResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.PredefinedAcceleratorResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.PredefinedAcceleratorResource] + :keyword next_link: + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Probe(_serialization.Model): + """Probe describes a health check to be performed against an App Instance to determine whether it + is alive or ready to receive traffic. + + All required parameters must be populated in order to send to server. + + :ivar probe_action: The action of the probe. + :vartype probe_action: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ProbeAction + :ivar disable_probe: Indicate whether the probe is disabled. Required. + :vartype disable_probe: bool + :ivar initial_delay_seconds: Number of seconds after the App Instance has started before probes + are initiated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + :vartype initial_delay_seconds: int + :ivar period_seconds: How often (in seconds) to perform the probe. Minimum value is 1. + :vartype period_seconds: int + :ivar timeout_seconds: Number of seconds after which the probe times out. Minimum value is 1. + :vartype timeout_seconds: int + :ivar failure_threshold: Minimum consecutive failures for the probe to be considered failed + after having succeeded. Minimum value is 1. + :vartype failure_threshold: int + :ivar success_threshold: Minimum consecutive successes for the probe to be considered + successful after having failed. Must be 1 for liveness and startup. Minimum value is 1. + :vartype success_threshold: int + """ + + _validation = { + "disable_probe": {"required": True}, + } + + _attribute_map = { + "probe_action": {"key": "probeAction", "type": "ProbeAction"}, + "disable_probe": {"key": "disableProbe", "type": "bool"}, + "initial_delay_seconds": {"key": "initialDelaySeconds", "type": "int"}, + "period_seconds": {"key": "periodSeconds", "type": "int"}, + "timeout_seconds": {"key": "timeoutSeconds", "type": "int"}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + } + + def __init__( + self, + *, + disable_probe: bool = False, + probe_action: Optional["_models.ProbeAction"] = None, + initial_delay_seconds: Optional[int] = None, + period_seconds: Optional[int] = None, + timeout_seconds: Optional[int] = None, + failure_threshold: Optional[int] = None, + success_threshold: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword probe_action: The action of the probe. + :paramtype probe_action: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ProbeAction + :keyword disable_probe: Indicate whether the probe is disabled. Required. + :paramtype disable_probe: bool + :keyword initial_delay_seconds: Number of seconds after the App Instance has started before + probes are initiated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + :paramtype initial_delay_seconds: int + :keyword period_seconds: How often (in seconds) to perform the probe. Minimum value is 1. + :paramtype period_seconds: int + :keyword timeout_seconds: Number of seconds after which the probe times out. Minimum value is + 1. + :paramtype timeout_seconds: int + :keyword failure_threshold: Minimum consecutive failures for the probe to be considered failed + after having succeeded. Minimum value is 1. + :paramtype failure_threshold: int + :keyword success_threshold: Minimum consecutive successes for the probe to be considered + successful after having failed. Must be 1 for liveness and startup. Minimum value is 1. + :paramtype success_threshold: int + """ + super().__init__(**kwargs) + self.probe_action = probe_action + self.disable_probe = disable_probe + self.initial_delay_seconds = initial_delay_seconds + self.period_seconds = period_seconds + self.timeout_seconds = timeout_seconds + self.failure_threshold = failure_threshold + self.success_threshold = success_threshold + + +class QueueScaleRule(_serialization.Model): + """Azure Spring Apps App Instance Azure Queue based scaling rule. + + :ivar queue_name: Queue name. + :vartype queue_name: str + :ivar queue_length: Queue length. + :vartype queue_length: int + :ivar auth: Authentication secrets for the queue scale rule. + :vartype auth: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ScaleRuleAuth] + """ + + _attribute_map = { + "queue_name": {"key": "queueName", "type": "str"}, + "queue_length": {"key": "queueLength", "type": "int"}, + "auth": {"key": "auth", "type": "[ScaleRuleAuth]"}, + } + + def __init__( + self, + *, + queue_name: Optional[str] = None, + queue_length: Optional[int] = None, + auth: Optional[List["_models.ScaleRuleAuth"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword queue_name: Queue name. + :paramtype queue_name: str + :keyword queue_length: Queue length. + :paramtype queue_length: int + :keyword auth: Authentication secrets for the queue scale rule. + :paramtype auth: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ScaleRuleAuth] + """ + super().__init__(**kwargs) + self.queue_name = queue_name + self.queue_length = queue_length + self.auth = auth + + +class RegenerateTestKeyRequestPayload(_serialization.Model): + """Regenerate test key request payload. + + All required parameters must be populated in order to send to server. + + :ivar key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". + :vartype key_type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.TestKeyType + """ + + _validation = { + "key_type": {"required": True}, + } + + _attribute_map = { + "key_type": {"key": "keyType", "type": "str"}, + } + + def __init__(self, *, key_type: Union[str, "_models.TestKeyType"], **kwargs: Any) -> None: + """ + :keyword key_type: Type of the test key. Required. Known values are: "Primary" and "Secondary". + :paramtype key_type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.TestKeyType + """ + super().__init__(**kwargs) + self.key_type = key_type + + +class RemoteDebugging(_serialization.Model): + """Remote debugging config. + + :ivar port: Application debugging port. + :vartype port: int + :ivar enabled: Indicate if remote debugging is enabled. + :vartype enabled: bool + """ + + _attribute_map = { + "port": {"key": "port", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, port: Optional[int] = None, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword port: Application debugging port. + :paramtype port: int + :keyword enabled: Indicate if remote debugging is enabled. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.port = port + self.enabled = enabled + + +class RemoteDebuggingPayload(_serialization.Model): + """Remote debugging payload. + + :ivar port: Application debugging port. + :vartype port: int + """ + + _attribute_map = { + "port": {"key": "port", "type": "int"}, + } + + def __init__(self, *, port: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword port: Application debugging port. + :paramtype port: int + """ + super().__init__(**kwargs) + self.port = port + + +class RequiredTraffic(_serialization.Model): + """Required inbound or outbound traffic for Azure Spring Apps resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar protocol: The protocol of required traffic. + :vartype protocol: str + :ivar port: The port of required traffic. + :vartype port: int + :ivar ips: The ip list of required traffic. + :vartype ips: list[str] + :ivar fqdns: The FQDN list of required traffic. + :vartype fqdns: list[str] + :ivar direction: The direction of required traffic. Known values are: "Inbound" and "Outbound". + :vartype direction: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.TrafficDirection + """ + + _validation = { + "protocol": {"readonly": True}, + "port": {"readonly": True}, + "ips": {"readonly": True}, + "fqdns": {"readonly": True}, + "direction": {"readonly": True}, + } + + _attribute_map = { + "protocol": {"key": "protocol", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "ips": {"key": "ips", "type": "[str]"}, + "fqdns": {"key": "fqdns", "type": "[str]"}, + "direction": {"key": "direction", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.protocol = None + self.port = None + self.ips = None + self.fqdns = None + self.direction = None + + +class ResourceRequests(_serialization.Model): + """Deployment resource request payload. + + :ivar cpu: Required CPU. 1 core can be represented by 1 or 1000m. This should be 500m or 1 for + Basic tier, and {500m, 1, 2, 3, 4} for Standard tier. + :vartype cpu: str + :ivar memory: Required memory. 1 GB can be represented by 1Gi or 1024Mi. This should be {512Mi, + 1Gi, 2Gi} for Basic tier, and {512Mi, 1Gi, 2Gi, ..., 8Gi} for Standard tier. + :vartype memory: str + """ + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + } + + def __init__(self, *, cpu: Optional[str] = None, memory: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword cpu: Required CPU. 1 core can be represented by 1 or 1000m. This should be 500m or 1 + for Basic tier, and {500m, 1, 2, 3, 4} for Standard tier. + :paramtype cpu: str + :keyword memory: Required memory. 1 GB can be represented by 1Gi or 1024Mi. This should be + {512Mi, 1Gi, 2Gi} for Basic tier, and {512Mi, 1Gi, 2Gi, ..., 8Gi} for Standard tier. + :paramtype memory: str + """ + super().__init__(**kwargs) + self.cpu = cpu + self.memory = memory + + +class ResourceSku(_serialization.Model): + """Describes an available Azure Spring Apps SKU. + + :ivar resource_type: Gets the type of resource the SKU applies to. + :vartype resource_type: str + :ivar name: Gets the name of SKU. + :vartype name: str + :ivar tier: Gets the tier of SKU. + :vartype tier: str + :ivar capacity: Gets the capacity of SKU. + :vartype capacity: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SkuCapacity + :ivar locations: Gets the set of locations that the SKU is available. + :vartype locations: list[str] + :ivar location_info: Gets a list of locations and availability zones in those locations where + the SKU is available. + :vartype location_info: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSkuLocationInfo] + :ivar restrictions: Gets the restrictions because of which SKU cannot be used. This is + empty if there are no restrictions. + :vartype restrictions: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSkuRestrictions] + """ + + _attribute_map = { + "resource_type": {"key": "resourceType", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "locations": {"key": "locations", "type": "[str]"}, + "location_info": {"key": "locationInfo", "type": "[ResourceSkuLocationInfo]"}, + "restrictions": {"key": "restrictions", "type": "[ResourceSkuRestrictions]"}, + } + + def __init__( + self, + *, + resource_type: Optional[str] = None, + name: Optional[str] = None, + tier: Optional[str] = None, + capacity: Optional["_models.SkuCapacity"] = None, + locations: Optional[List[str]] = None, + location_info: Optional[List["_models.ResourceSkuLocationInfo"]] = None, + restrictions: Optional[List["_models.ResourceSkuRestrictions"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword resource_type: Gets the type of resource the SKU applies to. + :paramtype resource_type: str + :keyword name: Gets the name of SKU. + :paramtype name: str + :keyword tier: Gets the tier of SKU. + :paramtype tier: str + :keyword capacity: Gets the capacity of SKU. + :paramtype capacity: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SkuCapacity + :keyword locations: Gets the set of locations that the SKU is available. + :paramtype locations: list[str] + :keyword location_info: Gets a list of locations and availability zones in those locations + where the SKU is available. + :paramtype location_info: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSkuLocationInfo] + :keyword restrictions: Gets the restrictions because of which SKU cannot be used. This is + empty if there are no restrictions. + :paramtype restrictions: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSkuRestrictions] + """ + super().__init__(**kwargs) + self.resource_type = resource_type + self.name = name + self.tier = tier + self.capacity = capacity + self.locations = locations + self.location_info = location_info + self.restrictions = restrictions + + +class ResourceSkuCapabilities(_serialization.Model): + """ResourceSkuCapabilities. + + :ivar name: Gets an invariant to describe the feature. + :vartype name: str + :ivar value: Gets an invariant if the feature is measured by quantity. + :vartype value: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: Gets an invariant to describe the feature. + :paramtype name: str + :keyword value: Gets an invariant if the feature is measured by quantity. + :paramtype value: str + """ + super().__init__(**kwargs) + self.name = name + self.value = value + + +class ResourceSkuCollection(_serialization.Model): + """Object that includes an array of Azure Spring Apps SKU and a possible link for next set. + + :ivar value: Collection of resource SKU. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSku] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ResourceSku]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.ResourceSku"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of resource SKU. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSku] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ResourceSkuLocationInfo(_serialization.Model): + """Locations and availability zones where the SKU is available. + + :ivar location: Gets location of the SKU. + :vartype location: str + :ivar zones: Gets list of availability zones where the SKU is supported. + :vartype zones: list[str] + :ivar zone_details: Gets details of capabilities available to a SKU in specific zones. + :vartype zone_details: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSkuZoneDetails] + """ + + _attribute_map = { + "location": {"key": "location", "type": "str"}, + "zones": {"key": "zones", "type": "[str]"}, + "zone_details": {"key": "zoneDetails", "type": "[ResourceSkuZoneDetails]"}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + zones: Optional[List[str]] = None, + zone_details: Optional[List["_models.ResourceSkuZoneDetails"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword location: Gets location of the SKU. + :paramtype location: str + :keyword zones: Gets list of availability zones where the SKU is supported. + :paramtype zones: list[str] + :keyword zone_details: Gets details of capabilities available to a SKU in specific zones. + :paramtype zone_details: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSkuZoneDetails] + """ + super().__init__(**kwargs) + self.location = location + self.zones = zones + self.zone_details = zone_details + + +class ResourceSkuRestrictionInfo(_serialization.Model): + """Information about the restriction where the SKU cannot be used. + + :ivar locations: Gets locations where the SKU is restricted. + :vartype locations: list[str] + :ivar zones: Gets list of availability zones where the SKU is restricted. + :vartype zones: list[str] + """ + + _attribute_map = { + "locations": {"key": "locations", "type": "[str]"}, + "zones": {"key": "zones", "type": "[str]"}, + } + + def __init__( + self, *, locations: Optional[List[str]] = None, zones: Optional[List[str]] = None, **kwargs: Any + ) -> None: + """ + :keyword locations: Gets locations where the SKU is restricted. + :paramtype locations: list[str] + :keyword zones: Gets list of availability zones where the SKU is restricted. + :paramtype zones: list[str] + """ + super().__init__(**kwargs) + self.locations = locations + self.zones = zones + + +class ResourceSkuRestrictions(_serialization.Model): + """Restrictions where the SKU cannot be used. + + :ivar type: Gets the type of restrictions. Possible values include: 'Location', 'Zone'. Known + values are: "Location" and "Zone". + :vartype type: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSkuRestrictionsType + :ivar values: Gets the value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :ivar restriction_info: Gets the information about the restriction where the SKU cannot be + used. + :vartype restriction_info: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSkuRestrictionInfo + :ivar reason_code: Gets the reason for restriction. Possible values include: 'QuotaId', + 'NotAvailableForSubscription'. Known values are: "QuotaId" and "NotAvailableForSubscription". + :vartype reason_code: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSkuRestrictionsReasonCode + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "values": {"key": "values", "type": "[str]"}, + "restriction_info": {"key": "restrictionInfo", "type": "ResourceSkuRestrictionInfo"}, + "reason_code": {"key": "reasonCode", "type": "str"}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "_models.ResourceSkuRestrictionsType"]] = None, + values: Optional[List[str]] = None, + restriction_info: Optional["_models.ResourceSkuRestrictionInfo"] = None, + reason_code: Optional[Union[str, "_models.ResourceSkuRestrictionsReasonCode"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: Gets the type of restrictions. Possible values include: 'Location', 'Zone'. + Known values are: "Location" and "Zone". + :paramtype type: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSkuRestrictionsType + :keyword values: Gets the value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :paramtype values: list[str] + :keyword restriction_info: Gets the information about the restriction where the SKU cannot be + used. + :paramtype restriction_info: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSkuRestrictionInfo + :keyword reason_code: Gets the reason for restriction. Possible values include: 'QuotaId', + 'NotAvailableForSubscription'. Known values are: "QuotaId" and "NotAvailableForSubscription". + :paramtype reason_code: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSkuRestrictionsReasonCode + """ + super().__init__(**kwargs) + self.type = type + self.values = values + self.restriction_info = restriction_info + self.reason_code = reason_code + + +class ResourceSkuZoneDetails(_serialization.Model): + """Details of capabilities available to a SKU in specific zones. + + :ivar name: Gets the set of zones that the SKU is available in with the + specified capabilities. + :vartype name: list[str] + :ivar capabilities: Gets a list of capabilities that are available for the SKU in the + specified list of zones. + :vartype capabilities: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSkuCapabilities] + """ + + _attribute_map = { + "name": {"key": "name", "type": "[str]"}, + "capabilities": {"key": "capabilities", "type": "[ResourceSkuCapabilities]"}, + } + + def __init__( + self, + *, + name: Optional[List[str]] = None, + capabilities: Optional[List["_models.ResourceSkuCapabilities"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Gets the set of zones that the SKU is available in with the + specified capabilities. + :paramtype name: list[str] + :keyword capabilities: Gets a list of capabilities that are available for the SKU in the + specified list of zones. + :paramtype capabilities: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSkuCapabilities] + """ + super().__init__(**kwargs) + self.name = name + self.capabilities = capabilities + + +class ResourceUploadDefinition(_serialization.Model): + """Resource upload definition payload. + + :ivar relative_path: Source relative path. + :vartype relative_path: str + :ivar upload_url: Upload URL. + :vartype upload_url: str + """ + + _attribute_map = { + "relative_path": {"key": "relativePath", "type": "str"}, + "upload_url": {"key": "uploadUrl", "type": "str"}, + } + + def __init__(self, *, relative_path: Optional[str] = None, upload_url: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword relative_path: Source relative path. + :paramtype relative_path: str + :keyword upload_url: Upload URL. + :paramtype upload_url: str + """ + super().__init__(**kwargs) + self.relative_path = relative_path + self.upload_url = upload_url + + +class Scale(_serialization.Model): + """Azure Spring Apps scaling configurations. + + :ivar min_replicas: Optional. Minimum number of container replicas. + :vartype min_replicas: int + :ivar max_replicas: Optional. Maximum number of container replicas. Defaults to 10 if not set. + :vartype max_replicas: int + :ivar rules: Scaling rules. + :vartype rules: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ScaleRule] + """ + + _attribute_map = { + "min_replicas": {"key": "minReplicas", "type": "int"}, + "max_replicas": {"key": "maxReplicas", "type": "int"}, + "rules": {"key": "rules", "type": "[ScaleRule]"}, + } + + def __init__( + self, + *, + min_replicas: Optional[int] = None, + max_replicas: int = 10, + rules: Optional[List["_models.ScaleRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword min_replicas: Optional. Minimum number of container replicas. + :paramtype min_replicas: int + :keyword max_replicas: Optional. Maximum number of container replicas. Defaults to 10 if not + set. + :paramtype max_replicas: int + :keyword rules: Scaling rules. + :paramtype rules: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ScaleRule] + """ + super().__init__(**kwargs) + self.min_replicas = min_replicas + self.max_replicas = max_replicas + self.rules = rules + + +class ScaleRule(_serialization.Model): + """Azure Spring Apps App Instance scaling rule. + + :ivar name: Scale Rule Name. + :vartype name: str + :ivar azure_queue: Azure Queue based scaling. + :vartype azure_queue: ~azure.mgmt.appplatform.v2024_05_01_preview.models.QueueScaleRule + :ivar custom: Custom scale rule. + :vartype custom: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomScaleRule + :ivar http: HTTP requests based scaling. + :vartype http: ~azure.mgmt.appplatform.v2024_05_01_preview.models.HttpScaleRule + :ivar tcp: Tcp requests based scaling. + :vartype tcp: ~azure.mgmt.appplatform.v2024_05_01_preview.models.TcpScaleRule + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "azure_queue": {"key": "azureQueue", "type": "QueueScaleRule"}, + "custom": {"key": "custom", "type": "CustomScaleRule"}, + "http": {"key": "http", "type": "HttpScaleRule"}, + "tcp": {"key": "tcp", "type": "TcpScaleRule"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + azure_queue: Optional["_models.QueueScaleRule"] = None, + custom: Optional["_models.CustomScaleRule"] = None, + http: Optional["_models.HttpScaleRule"] = None, + tcp: Optional["_models.TcpScaleRule"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Scale Rule Name. + :paramtype name: str + :keyword azure_queue: Azure Queue based scaling. + :paramtype azure_queue: ~azure.mgmt.appplatform.v2024_05_01_preview.models.QueueScaleRule + :keyword custom: Custom scale rule. + :paramtype custom: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomScaleRule + :keyword http: HTTP requests based scaling. + :paramtype http: ~azure.mgmt.appplatform.v2024_05_01_preview.models.HttpScaleRule + :keyword tcp: Tcp requests based scaling. + :paramtype tcp: ~azure.mgmt.appplatform.v2024_05_01_preview.models.TcpScaleRule + """ + super().__init__(**kwargs) + self.name = name + self.azure_queue = azure_queue + self.custom = custom + self.http = http + self.tcp = tcp + + +class ScaleRuleAuth(_serialization.Model): + """Auth Secrets for Azure Spring Apps App Instance Scale Rule. + + :ivar secret_ref: Name of the Azure Spring Apps App Instance secret from which to pull the auth + params. + :vartype secret_ref: str + :ivar trigger_parameter: Trigger Parameter that uses the secret. + :vartype trigger_parameter: str + """ + + _attribute_map = { + "secret_ref": {"key": "secretRef", "type": "str"}, + "trigger_parameter": {"key": "triggerParameter", "type": "str"}, + } + + def __init__( + self, *, secret_ref: Optional[str] = None, trigger_parameter: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword secret_ref: Name of the Azure Spring Apps App Instance secret from which to pull the + auth params. + :paramtype secret_ref: str + :keyword trigger_parameter: Trigger Parameter that uses the secret. + :paramtype trigger_parameter: str + """ + super().__init__(**kwargs) + self.secret_ref = secret_ref + self.trigger_parameter = trigger_parameter + + +class Secret(_serialization.Model): + """Secret definition. + + :ivar name: Secret Name. + :vartype name: str + :ivar value: Secret Value. + :vartype value: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: Secret Name. + :paramtype name: str + :keyword value: Secret Value. + :paramtype value: str + """ + super().__init__(**kwargs) + self.name = name + self.value = value + + +class ServiceRegistryInstance(_serialization.Model): + """Collection of instances belong to the Service Registry. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the Service Registry instance. + :vartype name: str + :ivar status: Status of the Service Registry instance. + :vartype status: str + """ + + _validation = { + "name": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.status = None + + +class ServiceRegistryProperties(_serialization.Model): + """Service Registry properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: State of the Service Registry. Known values are: "Creating", + "Updating", "Succeeded", "Failed", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceRegistryProvisioningState + :ivar resource_requests: The requested resource quantity for required CPU and Memory. + :vartype resource_requests: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceRegistryResourceRequests + :ivar instances: Collection of instances belong to Service Registry. + :vartype instances: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceRegistryInstance] + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "resource_requests": {"readonly": True}, + "instances": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resource_requests": {"key": "resourceRequests", "type": "ServiceRegistryResourceRequests"}, + "instances": {"key": "instances", "type": "[ServiceRegistryInstance]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.provisioning_state = None + self.resource_requests = None + self.instances = None + + +class ServiceRegistryResource(ProxyResource): + """Service Registry resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Service Registry properties payload. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceRegistryProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ServiceRegistryProperties"}, + } + + def __init__(self, *, properties: Optional["_models.ServiceRegistryProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Service Registry properties payload. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceRegistryProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class ServiceRegistryResourceCollection(_serialization.Model): + """Object that includes an array of Service Registry resources and a possible link for next set. + + :ivar value: Collection of Service Registry resources. + :vartype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceRegistryResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ServiceRegistryResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ServiceRegistryResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Service Registry resources. + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceRegistryResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ServiceRegistryResourceRequests(_serialization.Model): + """Resource request payload of Service Registry. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cpu: CPU allocated to each Service Registry instance. + :vartype cpu: str + :ivar memory: Memory allocated to each Service Registry instance. + :vartype memory: str + :ivar instance_count: Instance count of the Service Registry. + :vartype instance_count: int + """ + + _validation = { + "cpu": {"readonly": True}, + "memory": {"readonly": True}, + "instance_count": {"readonly": True}, + } + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.cpu = None + self.memory = None + self.instance_count = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar location: The GEO location of the resource. + :vartype location: str + :ivar tags: Tags of the service which is a list of key value pairs that describe the resource. + :vartype tags: dict[str, str] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword location: The GEO location of the resource. + :paramtype location: str + :keyword tags: Tags of the service which is a list of key value pairs that describe the + resource. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.location = location + self.tags = tags + + +class ServiceResource(TrackedResource): + """Service resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar location: The GEO location of the resource. + :vartype location: str + :ivar tags: Tags of the service which is a list of key value pairs that describe the resource. + :vartype tags: dict[str, str] + :ivar properties: Properties of the Service resource. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ClusterResourceProperties + :ivar identity: Managed Identity of the Service resource. + :vartype identity: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemAssignedServiceIdentity + :ivar sku: Sku of the Service resource. + :vartype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "ClusterResourceProperties"}, + "identity": {"key": "identity", "type": "SystemAssignedServiceIdentity"}, + "sku": {"key": "sku", "type": "Sku"}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.ClusterResourceProperties"] = None, + identity: Optional["_models.SystemAssignedServiceIdentity"] = None, + sku: Optional["_models.Sku"] = None, + **kwargs: Any + ) -> None: + """ + :keyword location: The GEO location of the resource. + :paramtype location: str + :keyword tags: Tags of the service which is a list of key value pairs that describe the + resource. + :paramtype tags: dict[str, str] + :keyword properties: Properties of the Service resource. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ClusterResourceProperties + :keyword identity: Managed Identity of the Service resource. + :paramtype identity: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemAssignedServiceIdentity + :keyword sku: Sku of the Service resource. + :paramtype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + super().__init__(location=location, tags=tags, **kwargs) + self.properties = properties + self.identity = identity + self.sku = sku + + +class ServiceResourceList(_serialization.Model): + """Object that includes an array of Service resources and a possible link for next set. + + :ivar value: Collection of Service resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ServiceResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.ServiceResource"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Service resources. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ServiceSpecification(_serialization.Model): + """Service specification payload. + + :ivar log_specifications: Specifications of the Log for Azure Monitoring. + :vartype log_specifications: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.LogSpecification] + :ivar metric_specifications: Specifications of the Metrics for Azure Monitoring. + :vartype metric_specifications: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.MetricSpecification] + """ + + _attribute_map = { + "log_specifications": {"key": "logSpecifications", "type": "[LogSpecification]"}, + "metric_specifications": {"key": "metricSpecifications", "type": "[MetricSpecification]"}, + } + + def __init__( + self, + *, + log_specifications: Optional[List["_models.LogSpecification"]] = None, + metric_specifications: Optional[List["_models.MetricSpecification"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword log_specifications: Specifications of the Log for Azure Monitoring. + :paramtype log_specifications: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.LogSpecification] + :keyword metric_specifications: Specifications of the Metrics for Azure Monitoring. + :paramtype metric_specifications: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.MetricSpecification] + """ + super().__init__(**kwargs) + self.log_specifications = log_specifications + self.metric_specifications = metric_specifications + + +class ServiceVNetAddons(_serialization.Model): + """Additional Service settings in vnet injection instance. + + :ivar log_stream_public_endpoint: Indicates whether the log stream in vnet injection instance + could be accessed from internet. + :vartype log_stream_public_endpoint: bool + :ivar data_plane_public_endpoint: Indicates whether the data plane components(log stream, app + connect, remote debugging) in vnet injection instance could be accessed from internet. + :vartype data_plane_public_endpoint: bool + :ivar private_storage_access: Indicates whether the vnet injection service enables private + links for backend storage account and container registry. Known values are: "Enabled" and + "Disabled". + :vartype private_storage_access: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.PrivateStorageAccess + :ivar private_dns_zone_id: Fully qualified resource Id of the Private DNS zone to link with the + customer virtual network. + :vartype private_dns_zone_id: str + """ + + _attribute_map = { + "log_stream_public_endpoint": {"key": "logStreamPublicEndpoint", "type": "bool"}, + "data_plane_public_endpoint": {"key": "dataPlanePublicEndpoint", "type": "bool"}, + "private_storage_access": {"key": "privateStorageAccess", "type": "str"}, + "private_dns_zone_id": {"key": "privateDnsZoneId", "type": "str"}, + } + + def __init__( + self, + *, + log_stream_public_endpoint: bool = False, + data_plane_public_endpoint: bool = False, + private_storage_access: Optional[Union[str, "_models.PrivateStorageAccess"]] = None, + private_dns_zone_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword log_stream_public_endpoint: Indicates whether the log stream in vnet injection + instance could be accessed from internet. + :paramtype log_stream_public_endpoint: bool + :keyword data_plane_public_endpoint: Indicates whether the data plane components(log stream, + app connect, remote debugging) in vnet injection instance could be accessed from internet. + :paramtype data_plane_public_endpoint: bool + :keyword private_storage_access: Indicates whether the vnet injection service enables private + links for backend storage account and container registry. Known values are: "Enabled" and + "Disabled". + :paramtype private_storage_access: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.PrivateStorageAccess + :keyword private_dns_zone_id: Fully qualified resource Id of the Private DNS zone to link with + the customer virtual network. + :paramtype private_dns_zone_id: str + """ + super().__init__(**kwargs) + self.log_stream_public_endpoint = log_stream_public_endpoint + self.data_plane_public_endpoint = data_plane_public_endpoint + self.private_storage_access = private_storage_access + self.private_dns_zone_id = private_dns_zone_id + + +class Sku(_serialization.Model): + """Sku of Azure Spring Apps. + + :ivar name: Name of the Sku. + :vartype name: str + :ivar tier: Tier of the Sku. + :vartype tier: str + :ivar capacity: Current capacity of the target resource. + :vartype capacity: int + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, + } + + def __init__( + self, *, name: str = "S0", tier: str = "Standard", capacity: Optional[int] = None, **kwargs: Any + ) -> None: + """ + :keyword name: Name of the Sku. + :paramtype name: str + :keyword tier: Tier of the Sku. + :paramtype tier: str + :keyword capacity: Current capacity of the target resource. + :paramtype capacity: int + """ + super().__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity + + +class SkuCapacity(_serialization.Model): + """The SKU capacity. + + All required parameters must be populated in order to send to server. + + :ivar minimum: Gets or sets the minimum. Required. + :vartype minimum: int + :ivar maximum: Gets or sets the maximum. + :vartype maximum: int + :ivar default: Gets or sets the default. + :vartype default: int + :ivar scale_type: Gets or sets the type of the scale. Known values are: "None", "Manual", and + "Automatic". + :vartype scale_type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.SkuScaleType + """ + + _validation = { + "minimum": {"required": True}, + } + + _attribute_map = { + "minimum": {"key": "minimum", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "default": {"key": "default", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, + } + + def __init__( + self, + *, + minimum: int, + maximum: Optional[int] = None, + default: Optional[int] = None, + scale_type: Optional[Union[str, "_models.SkuScaleType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword minimum: Gets or sets the minimum. Required. + :paramtype minimum: int + :keyword maximum: Gets or sets the maximum. + :paramtype maximum: int + :keyword default: Gets or sets the default. + :paramtype default: int + :keyword scale_type: Gets or sets the type of the scale. Known values are: "None", "Manual", + and "Automatic". + :paramtype scale_type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.SkuScaleType + """ + super().__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + self.default = default + self.scale_type = scale_type + + +class SkuObject(_serialization.Model): + """Resource Sku object used for scaling out and scaling in. + + :ivar sku: Sku of the Spring Cloud Gateway resource. + :vartype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + + _attribute_map = { + "sku": {"key": "sku", "type": "Sku"}, + } + + def __init__(self, *, sku: Optional["_models.Sku"] = None, **kwargs: Any) -> None: + """ + :keyword sku: Sku of the Spring Cloud Gateway resource. + :paramtype sku: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Sku + """ + super().__init__(**kwargs) + self.sku = sku + + +class SourceUploadedUserSourceInfo(UploadedUserSourceInfo): + """Uploaded Java source code binary for a deployment. + + All required parameters must be populated in order to send to server. + + :ivar type: Type of the source uploaded. Required. + :vartype type: str + :ivar version: Version of the source. + :vartype version: str + :ivar relative_path: Relative path of the storage which stores the source. + :vartype relative_path: str + :ivar artifact_selector: Selector for the artifact to be used for the deployment for + multi-module projects. This should be + the relative path to the target module/project. + :vartype artifact_selector: str + :ivar runtime_version: Runtime version of the source file. + :vartype runtime_version: str + """ + + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "relative_path": {"key": "relativePath", "type": "str"}, + "artifact_selector": {"key": "artifactSelector", "type": "str"}, + "runtime_version": {"key": "runtimeVersion", "type": "str"}, + } + + def __init__( + self, + *, + version: Optional[str] = None, + relative_path: Optional[str] = None, + artifact_selector: Optional[str] = None, + runtime_version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword version: Version of the source. + :paramtype version: str + :keyword relative_path: Relative path of the storage which stores the source. + :paramtype relative_path: str + :keyword artifact_selector: Selector for the artifact to be used for the deployment for + multi-module projects. This should be + the relative path to the target module/project. + :paramtype artifact_selector: str + :keyword runtime_version: Runtime version of the source file. + :paramtype runtime_version: str + """ + super().__init__(version=version, relative_path=relative_path, **kwargs) + self.type: str = "Source" + self.artifact_selector = artifact_selector + self.runtime_version = runtime_version + + +class SsoProperties(_serialization.Model): + """Single sign-on related configuration. + + :ivar scope: It defines the specific actions applications can be allowed to do on a user's + behalf. + :vartype scope: list[str] + :ivar client_id: The public identifier for the application. + :vartype client_id: str + :ivar client_secret: The secret known only to the application and the authorization server. + :vartype client_secret: str + :ivar issuer_uri: The URI of Issuer Identifier. + :vartype issuer_uri: str + """ + + _attribute_map = { + "scope": {"key": "scope", "type": "[str]"}, + "client_id": {"key": "clientId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, + "issuer_uri": {"key": "issuerUri", "type": "str"}, + } + + def __init__( + self, + *, + scope: Optional[List[str]] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + issuer_uri: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword scope: It defines the specific actions applications can be allowed to do on a user's + behalf. + :paramtype scope: list[str] + :keyword client_id: The public identifier for the application. + :paramtype client_id: str + :keyword client_secret: The secret known only to the application and the authorization server. + :paramtype client_secret: str + :keyword issuer_uri: The URI of Issuer Identifier. + :paramtype issuer_uri: str + """ + super().__init__(**kwargs) + self.scope = scope + self.client_id = client_id + self.client_secret = client_secret + self.issuer_uri = issuer_uri + + +class StackProperties(_serialization.Model): + """KPack ClusterStack properties payload. + + :ivar id: Id of the ClusterStack. + :vartype id: str + :ivar version: Version of the ClusterStack. + :vartype version: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "version": {"key": "version", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Id of the ClusterStack. + :paramtype id: str + :keyword version: Version of the ClusterStack. + :paramtype version: str + """ + super().__init__(**kwargs) + self.id = id + self.version = version + + +class StorageProperties(_serialization.Model): + """Storage resource payload. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + StorageAccount + + All required parameters must be populated in order to send to server. + + :ivar storage_type: The type of the storage. Required. "StorageAccount" + :vartype storage_type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageType + """ + + _validation = { + "storage_type": {"required": True}, + } + + _attribute_map = { + "storage_type": {"key": "storageType", "type": "str"}, + } + + _subtype_map = {"storage_type": {"StorageAccount": "StorageAccount"}} + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.storage_type: Optional[str] = None + + +class StorageAccount(StorageProperties): + """storage resource of type Azure Storage Account. + + All required parameters must be populated in order to send to server. + + :ivar storage_type: The type of the storage. Required. "StorageAccount" + :vartype storage_type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageType + :ivar account_name: The account name of the Azure Storage Account. Required. + :vartype account_name: str + :ivar account_key: The account key of the Azure Storage Account. Required. + :vartype account_key: str + """ + + _validation = { + "storage_type": {"required": True}, + "account_name": {"required": True}, + "account_key": {"required": True}, + } + + _attribute_map = { + "storage_type": {"key": "storageType", "type": "str"}, + "account_name": {"key": "accountName", "type": "str"}, + "account_key": {"key": "accountKey", "type": "str"}, + } + + def __init__(self, *, account_name: str, account_key: str, **kwargs: Any) -> None: + """ + :keyword account_name: The account name of the Azure Storage Account. Required. + :paramtype account_name: str + :keyword account_key: The account key of the Azure Storage Account. Required. + :paramtype account_key: str + """ + super().__init__(**kwargs) + self.storage_type: str = "StorageAccount" + self.account_name = account_name + self.account_key = account_key + + +class StorageResource(ProxyResource): + """Storage resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Properties of the storage resource payload. + :vartype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "StorageProperties"}, + } + + def __init__(self, *, properties: Optional["_models.StorageProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of the storage resource payload. + :paramtype properties: ~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class StorageResourceCollection(_serialization.Model): + """Collection compose of storage resources list and a possible link for next page. + + :ivar value: The storage resources list. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource] + :ivar next_link: The link to next page of storage list. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[StorageResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.StorageResource"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The storage resources list. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource] + :keyword next_link: The link to next page of storage list. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SupportedApmType(_serialization.Model): + """Supported APM type. + + :ivar name: The name of the supported APM type. + :vartype name: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: The name of the supported APM type. + :paramtype name: str + """ + super().__init__(**kwargs) + self.name = name + + +class SupportedApmTypes(_serialization.Model): + """Supported APM types payload. + + :ivar value: Collection of the supported APM type. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedApmType] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[SupportedApmType]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.SupportedApmType"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of the supported APM type. + :paramtype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedApmType] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SupportedBuildpackResource(ProxyResource): + """Supported buildpack resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Supported buildpack resource properties. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedBuildpackResourceProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "SupportedBuildpackResourceProperties"}, + } + + def __init__( + self, *, properties: Optional["_models.SupportedBuildpackResourceProperties"] = None, **kwargs: Any + ) -> None: + """ + :keyword properties: Supported buildpack resource properties. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedBuildpackResourceProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class SupportedBuildpackResourceProperties(_serialization.Model): + """Supported buildpack resource properties. + + :ivar buildpack_id: The id of supported buildpack. + :vartype buildpack_id: str + :ivar version: The version of supported buildpack. + :vartype version: str + """ + + _attribute_map = { + "buildpack_id": {"key": "buildpackId", "type": "str"}, + "version": {"key": "version", "type": "str"}, + } + + def __init__(self, *, buildpack_id: Optional[str] = None, version: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword buildpack_id: The id of supported buildpack. + :paramtype buildpack_id: str + :keyword version: The version of supported buildpack. + :paramtype version: str + """ + super().__init__(**kwargs) + self.buildpack_id = buildpack_id + self.version = version + + +class SupportedBuildpacksCollection(_serialization.Model): + """Object that includes an array of supported buildpacks resources and a possible link for next + set. + + :ivar value: Collection of supported buildpacks resources. + :vartype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedBuildpackResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[SupportedBuildpackResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.SupportedBuildpackResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of supported buildpacks resources. + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedBuildpackResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SupportedRuntimeVersion(_serialization.Model): + """Supported deployment runtime version descriptor. + + :ivar value: The raw value which could be passed to deployment CRUD operations. Known values + are: "Java_8", "Java_11", "Java_17", "Java_21", and "NetCore_31". + :vartype value: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedRuntimeValue + :ivar platform: The platform of this runtime version (possible values: "Java" or ".NET"). Known + values are: "Java" and ".NET Core". + :vartype platform: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedRuntimePlatform + :ivar version: The detailed version (major.minor) of the platform. + :vartype version: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "str"}, + "platform": {"key": "platform", "type": "str"}, + "version": {"key": "version", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[Union[str, "_models.SupportedRuntimeValue"]] = None, + platform: Optional[Union[str, "_models.SupportedRuntimePlatform"]] = None, + version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: The raw value which could be passed to deployment CRUD operations. Known values + are: "Java_8", "Java_11", "Java_17", "Java_21", and "NetCore_31". + :paramtype value: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedRuntimeValue + :keyword platform: The platform of this runtime version (possible values: "Java" or ".NET"). + Known values are: "Java" and ".NET Core". + :paramtype platform: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedRuntimePlatform + :keyword version: The detailed version (major.minor) of the platform. + :paramtype version: str + """ + super().__init__(**kwargs) + self.value = value + self.platform = platform + self.version = version + + +class SupportedServerVersion(_serialization.Model): + """Supported server version. + + :ivar value: The raw server version value which could be passed to deployment CRUD operations. + :vartype value: str + :ivar server: The server name. + :vartype server: str + :ivar version: The Server version. + :vartype version: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "str"}, + "server": {"key": "server", "type": "str"}, + "version": {"key": "version", "type": "str"}, + } + + def __init__( + self, *, value: Optional[str] = None, server: Optional[str] = None, version: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The raw server version value which could be passed to deployment CRUD + operations. + :paramtype value: str + :keyword server: The server name. + :paramtype server: str + :keyword version: The Server version. + :paramtype version: str + """ + super().__init__(**kwargs) + self.value = value + self.server = server + self.version = version + + +class SupportedServerVersions(_serialization.Model): + """Supported server versions. + + :ivar value: Collection of the supported server versions. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedServerVersion] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[SupportedServerVersion]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.SupportedServerVersion"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of the supported server versions. + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedServerVersion] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SupportedStackResource(ProxyResource): + """Supported stack resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemData + :ivar properties: Supported stack resource properties. + :vartype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedStackResourceProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "SupportedStackResourceProperties"}, + } + + def __init__( + self, *, properties: Optional["_models.SupportedStackResourceProperties"] = None, **kwargs: Any + ) -> None: + """ + :keyword properties: Supported stack resource properties. + :paramtype properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedStackResourceProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class SupportedStackResourceProperties(_serialization.Model): + """Supported stack resource properties. + + :ivar stack_id: The id of supported stack. + :vartype stack_id: str + :ivar version: The version of supported stack. + :vartype version: str + """ + + _attribute_map = { + "stack_id": {"key": "stackId", "type": "str"}, + "version": {"key": "version", "type": "str"}, + } + + def __init__(self, *, stack_id: Optional[str] = None, version: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword stack_id: The id of supported stack. + :paramtype stack_id: str + :keyword version: The version of supported stack. + :paramtype version: str + """ + super().__init__(**kwargs) + self.stack_id = stack_id + self.version = version + + +class SupportedStacksCollection(_serialization.Model): + """Object that includes an array of supported stacks resources and a possible link for next set. + + :ivar value: Collection of supported stacks resources. + :vartype value: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedStackResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[SupportedStackResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.SupportedStackResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of supported stacks resources. + :paramtype value: + list[~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedStackResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SystemAssignedServiceIdentity(_serialization.Model): + """Managed service identity (either system assigned, or none). + + 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 server. + + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: Type of managed service identity (either system assigned, or none). Required. Known + values are: "None" and "SystemAssigned". + :vartype type: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemAssignedServiceIdentityType + """ + + _validation = { + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, *, type: Union[str, "_models.SystemAssignedServiceIdentityType"], **kwargs: Any) -> None: + """ + :keyword type: Type of managed service identity (either system assigned, or none). Required. + Known values are: "None" and "SystemAssigned". + :paramtype type: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.SystemAssignedServiceIdentityType + """ + super().__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class SystemData(_serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.LastModifiedByType + :ivar last_modified_at: The timestamp of resource modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.LastModifiedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :paramtype created_by_type: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Known + values are: "User", "Application", "ManagedIdentity", and "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.LastModifiedByType + :keyword last_modified_at: The timestamp of resource modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super().__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TcpScaleRule(_serialization.Model): + """Azure Spring Apps App Instance Tcp scaling rule. + + :ivar metadata: Metadata properties to describe tcp scale rule. + :vartype metadata: dict[str, str] + :ivar auth: Authentication secrets for the tcp scale rule. + :vartype auth: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ScaleRuleAuth] + """ + + _attribute_map = { + "metadata": {"key": "metadata", "type": "{str}"}, + "auth": {"key": "auth", "type": "[ScaleRuleAuth]"}, + } + + def __init__( + self, + *, + metadata: Optional[Dict[str, str]] = None, + auth: Optional[List["_models.ScaleRuleAuth"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword metadata: Metadata properties to describe tcp scale rule. + :paramtype metadata: dict[str, str] + :keyword auth: Authentication secrets for the tcp scale rule. + :paramtype auth: list[~azure.mgmt.appplatform.v2024_05_01_preview.models.ScaleRuleAuth] + """ + super().__init__(**kwargs) + self.metadata = metadata + self.auth = auth + + +class TCPSocketAction(ProbeAction): + """TCPSocketAction describes an action based on opening a socket. + + All required parameters must be populated in order to send to server. + + :ivar type: The type of the action to take to perform the health check. Required. Known values + are: "HTTPGetAction", "TCPSocketAction", and "ExecAction". + :vartype type: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.ProbeActionType + """ + + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.type: str = "TCPSocketAction" + + +class TemporaryDisk(_serialization.Model): + """Temporary disk payload. + + :ivar size_in_gb: Size of the temporary disk in GB. + :vartype size_in_gb: int + :ivar mount_path: Mount path of the temporary disk. + :vartype mount_path: str + """ + + _validation = { + "size_in_gb": {"maximum": 5, "minimum": 0}, + } + + _attribute_map = { + "size_in_gb": {"key": "sizeInGB", "type": "int"}, + "mount_path": {"key": "mountPath", "type": "str"}, + } + + def __init__(self, *, size_in_gb: Optional[int] = None, mount_path: str = "/tmp", **kwargs: Any) -> None: + """ + :keyword size_in_gb: Size of the temporary disk in GB. + :paramtype size_in_gb: int + :keyword mount_path: Mount path of the temporary disk. + :paramtype mount_path: str + """ + super().__init__(**kwargs) + self.size_in_gb = size_in_gb + self.mount_path = mount_path + + +class TestKeys(_serialization.Model): + """Test keys payload. + + :ivar primary_key: Primary key. + :vartype primary_key: str + :ivar secondary_key: Secondary key. + :vartype secondary_key: str + :ivar primary_test_endpoint: Primary test endpoint. + :vartype primary_test_endpoint: str + :ivar secondary_test_endpoint: Secondary test endpoint. + :vartype secondary_test_endpoint: str + :ivar enabled: Indicates whether the test endpoint feature enabled or not. + :vartype enabled: bool + """ + + _attribute_map = { + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, + "primary_test_endpoint": {"key": "primaryTestEndpoint", "type": "str"}, + "secondary_test_endpoint": {"key": "secondaryTestEndpoint", "type": "str"}, + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__( + self, + *, + primary_key: Optional[str] = None, + secondary_key: Optional[str] = None, + primary_test_endpoint: Optional[str] = None, + secondary_test_endpoint: Optional[str] = None, + enabled: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword primary_key: Primary key. + :paramtype primary_key: str + :keyword secondary_key: Secondary key. + :paramtype secondary_key: str + :keyword primary_test_endpoint: Primary test endpoint. + :paramtype primary_test_endpoint: str + :keyword secondary_test_endpoint: Secondary test endpoint. + :paramtype secondary_test_endpoint: str + :keyword enabled: Indicates whether the test endpoint feature enabled or not. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.primary_key = primary_key + self.secondary_key = secondary_key + self.primary_test_endpoint = primary_test_endpoint + self.secondary_test_endpoint = secondary_test_endpoint + self.enabled = enabled + + +class TriggeredBuildResult(_serialization.Model): + """The build result triggered by a build. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The unique build id of this build result. + :vartype id: str + :ivar provisioning_state: The provisioning state of this build result. Known values are: + "Queuing", "Building", "Succeeded", "Failed", "Deleting", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2024_05_01_preview.models.TriggeredBuildResultProvisioningState + :ivar image: The container image of this build result. + :vartype image: str + :ivar last_transition_time: The last transition time of this build result. + :vartype last_transition_time: ~datetime.datetime + :ivar last_transition_reason: The last transition reason of this build result. + :vartype last_transition_reason: str + :ivar last_transition_status: The last transition status of this build result. + :vartype last_transition_status: str + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "last_transition_time": {"key": "lastTransitionTime", "type": "iso-8601"}, + "last_transition_reason": {"key": "lastTransitionReason", "type": "str"}, + "last_transition_status": {"key": "lastTransitionStatus", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + image: Optional[str] = None, + last_transition_time: Optional[datetime.datetime] = None, + last_transition_reason: Optional[str] = None, + last_transition_status: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: The unique build id of this build result. + :paramtype id: str + :keyword image: The container image of this build result. + :paramtype image: str + :keyword last_transition_time: The last transition time of this build result. + :paramtype last_transition_time: ~datetime.datetime + :keyword last_transition_reason: The last transition reason of this build result. + :paramtype last_transition_reason: str + :keyword last_transition_status: The last transition status of this build result. + :paramtype last_transition_status: str + """ + super().__init__(**kwargs) + self.id = id + self.provisioning_state = None + self.image = image + self.last_transition_time = last_transition_time + self.last_transition_reason = last_transition_reason + self.last_transition_status = last_transition_status + + +class UserAssignedManagedIdentity(_serialization.Model): + """The details of the user-assigned managed identity assigned to an App. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Principal Id of user-assigned managed identity. + :vartype principal_id: str + :ivar client_id: Client Id of user-assigned managed identity. + :vartype client_id: str + """ + + _validation = { + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ValidationMessages(_serialization.Model): + """Validate messages of the configuration service git repositories. + + :ivar name: The name of the configuration service git repository. + :vartype name: str + :ivar messages: Detailed validation messages. + :vartype messages: list[str] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "messages": {"key": "messages", "type": "[str]"}, + } + + def __init__(self, *, name: Optional[str] = None, messages: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword name: The name of the configuration service git repository. + :paramtype name: str + :keyword messages: Detailed validation messages. + :paramtype messages: list[str] + """ + super().__init__(**kwargs) + self.name = name + self.messages = messages + + +class WarUploadedUserSourceInfo(UploadedUserSourceInfo): + """Uploaded War binary for a deployment. + + All required parameters must be populated in order to send to server. + + :ivar type: Type of the source uploaded. Required. + :vartype type: str + :ivar version: Version of the source. + :vartype version: str + :ivar relative_path: Relative path of the storage which stores the source. + :vartype relative_path: str + :ivar runtime_version: Runtime version of the war file. + :vartype runtime_version: str + :ivar jvm_options: JVM parameter. + :vartype jvm_options: str + :ivar server_version: Server version, currently only Apache Tomcat is supported. + :vartype server_version: str + """ + + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "relative_path": {"key": "relativePath", "type": "str"}, + "runtime_version": {"key": "runtimeVersion", "type": "str"}, + "jvm_options": {"key": "jvmOptions", "type": "str"}, + "server_version": {"key": "serverVersion", "type": "str"}, + } + + def __init__( + self, + *, + version: Optional[str] = None, + relative_path: Optional[str] = None, + runtime_version: Optional[str] = None, + jvm_options: Optional[str] = None, + server_version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword version: Version of the source. + :paramtype version: str + :keyword relative_path: Relative path of the storage which stores the source. + :paramtype relative_path: str + :keyword runtime_version: Runtime version of the war file. + :paramtype runtime_version: str + :keyword jvm_options: JVM parameter. + :paramtype jvm_options: str + :keyword server_version: Server version, currently only Apache Tomcat is supported. + :paramtype server_version: str + """ + super().__init__(version=version, relative_path=relative_path, **kwargs) + self.type: str = "War" + self.runtime_version = runtime_version + self.jvm_options = jvm_options + self.server_version = server_version + + +class WeeklyMaintenanceScheduleConfiguration(MaintenanceScheduleConfiguration): + """Weekly planned maintenance. + + 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 server. + + :ivar frequency: The frequency to run the maintenance job. Required. "Weekly" + :vartype frequency: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.Frequency + :ivar hour: The hour to run the maintenance job. Required. + :vartype hour: int + :ivar duration: The duration time to run the maintenance job, specified in ISO8601 format, e.g. + PT8H. + :vartype duration: str + :ivar day: The day to run the maintenance job. Required. Known values are: "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday", and "Sunday". + :vartype day: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.WeekDay + """ + + _validation = { + "frequency": {"required": True}, + "hour": {"required": True, "maximum": 23, "minimum": 0}, + "duration": {"readonly": True}, + "day": {"required": True}, + } + + _attribute_map = { + "frequency": {"key": "frequency", "type": "str"}, + "hour": {"key": "hour", "type": "int"}, + "duration": {"key": "duration", "type": "str"}, + "day": {"key": "day", "type": "str"}, + } + + def __init__(self, *, hour: int, day: Union[str, "_models.WeekDay"], **kwargs: Any) -> None: + """ + :keyword hour: The hour to run the maintenance job. Required. + :paramtype hour: int + :keyword day: The day to run the maintenance job. Required. Known values are: "Monday", + "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", and "Sunday". + :paramtype day: str or ~azure.mgmt.appplatform.v2024_05_01_preview.models.WeekDay + """ + super().__init__(**kwargs) + self.frequency: str = "Weekly" + self.hour = hour + self.duration = None + self.day = day diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/models/_patch.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/__init__.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/__init__.py new file mode 100644 index 00000000000..fe654e1adb1 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/__init__.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._services_operations import ServicesOperations +from ._apms_operations import ApmsOperations +from ._eureka_servers_operations import EurekaServersOperations +from ._config_servers_operations import ConfigServersOperations +from ._configuration_services_operations import ConfigurationServicesOperations +from ._service_registries_operations import ServiceRegistriesOperations +from ._application_live_views_operations import ApplicationLiveViewsOperations +from ._dev_tool_portals_operations import DevToolPortalsOperations +from ._container_registries_operations import ContainerRegistriesOperations +from ._build_service_operations import BuildServiceOperations +from ._buildpack_binding_operations import BuildpackBindingOperations +from ._build_service_builder_operations import BuildServiceBuilderOperations +from ._build_service_agent_pool_operations import BuildServiceAgentPoolOperations +from ._monitoring_settings_operations import MonitoringSettingsOperations +from ._apps_operations import AppsOperations +from ._bindings_operations import BindingsOperations +from ._storages_operations import StoragesOperations +from ._certificates_operations import CertificatesOperations +from ._custom_domains_operations import CustomDomainsOperations +from ._deployments_operations import DeploymentsOperations +from ._operations import Operations +from ._runtime_versions_operations import RuntimeVersionsOperations +from ._skus_operations import SkusOperations +from ._gateways_operations import GatewaysOperations +from ._gateway_route_configs_operations import GatewayRouteConfigsOperations +from ._gateway_custom_domains_operations import GatewayCustomDomainsOperations +from ._api_portals_operations import ApiPortalsOperations +from ._api_portal_custom_domains_operations import ApiPortalCustomDomainsOperations +from ._application_accelerators_operations import ApplicationAcceleratorsOperations +from ._customized_accelerators_operations import CustomizedAcceleratorsOperations +from ._predefined_accelerators_operations import PredefinedAcceleratorsOperations +from ._jobs_operations import JobsOperations +from ._job_operations import JobOperations +from ._job_execution_operations import JobExecutionOperations +from ._job_executions_operations import JobExecutionsOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ServicesOperations", + "ApmsOperations", + "EurekaServersOperations", + "ConfigServersOperations", + "ConfigurationServicesOperations", + "ServiceRegistriesOperations", + "ApplicationLiveViewsOperations", + "DevToolPortalsOperations", + "ContainerRegistriesOperations", + "BuildServiceOperations", + "BuildpackBindingOperations", + "BuildServiceBuilderOperations", + "BuildServiceAgentPoolOperations", + "MonitoringSettingsOperations", + "AppsOperations", + "BindingsOperations", + "StoragesOperations", + "CertificatesOperations", + "CustomDomainsOperations", + "DeploymentsOperations", + "Operations", + "RuntimeVersionsOperations", + "SkusOperations", + "GatewaysOperations", + "GatewayRouteConfigsOperations", + "GatewayCustomDomainsOperations", + "ApiPortalsOperations", + "ApiPortalCustomDomainsOperations", + "ApplicationAcceleratorsOperations", + "CustomizedAcceleratorsOperations", + "PredefinedAcceleratorsOperations", + "JobsOperations", + "JobOperations", + "JobExecutionOperations", + "JobExecutionsOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_api_portal_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_api_portal_custom_domains_operations.py new file mode 100644 index 00000000000..71b2c7f82c5 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_api_portal_custom_domains_operations.py @@ -0,0 +1,701 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + service_name: str, + api_portal_name: str, + domain_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "apiPortalName": _SERIALIZER.url("api_portal_name", api_portal_name, "str"), + "domainName": _SERIALIZER.url("domain_name", domain_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, + service_name: str, + api_portal_name: str, + domain_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "apiPortalName": _SERIALIZER.url("api_portal_name", api_portal_name, "str"), + "domainName": _SERIALIZER.url("domain_name", domain_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + service_name: str, + api_portal_name: str, + domain_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "apiPortalName": _SERIALIZER.url("api_portal_name", api_portal_name, "str"), + "domainName": _SERIALIZER.url("domain_name", domain_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, service_name: str, api_portal_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "apiPortalName": _SERIALIZER.url("api_portal_name", api_portal_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ApiPortalCustomDomainsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`api_portal_custom_domains` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any + ) -> _models.ApiPortalCustomDomainResource: + """Get the API portal custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param domain_name: The name of the API portal custom domain. Required. + :type domain_name: str + :return: ApiPortalCustomDomainResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + domain_name: str, + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> _models.ApiPortalCustomDomainResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(api_portal_custom_domain_resource, (IOBase, bytes)): + _content = api_portal_custom_domain_resource + else: + _json = self._serialize.body(api_portal_custom_domain_resource, "ApiPortalCustomDomainResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + domain_name: str, + api_portal_custom_domain_resource: _models.ApiPortalCustomDomainResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApiPortalCustomDomainResource]: + """Create or update the API portal custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param domain_name: The name of the API portal custom domain. Required. + :type domain_name: str + :param api_portal_custom_domain_resource: The API portal custom domain for the create or update + operation. Required. + :type api_portal_custom_domain_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + domain_name: str, + api_portal_custom_domain_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApiPortalCustomDomainResource]: + """Create or update the API portal custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param domain_name: The name of the API portal custom domain. Required. + :type domain_name: str + :param api_portal_custom_domain_resource: The API portal custom domain for the create or update + operation. Required. + :type api_portal_custom_domain_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + domain_name: str, + api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ApiPortalCustomDomainResource]: + """Create or update the API portal custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param domain_name: The name of the API portal custom domain. Required. + :type domain_name: str + :param api_portal_custom_domain_resource: The API portal custom domain for the create or update + operation. Is either a ApiPortalCustomDomainResource type or a IO[bytes] type. Required. + :type api_portal_custom_domain_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource or IO[bytes] + :return: An instance of LROPoller that returns either ApiPortalCustomDomainResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApiPortalCustomDomainResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + domain_name=domain_name, + api_portal_custom_domain_resource=api_portal_custom_domain_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApiPortalCustomDomainResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ApiPortalCustomDomainResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ApiPortalCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete the API portal custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param domain_name: The name of the API portal custom domain. Required. + :type domain_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + domain_name=domain_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any + ) -> Iterable["_models.ApiPortalCustomDomainResource"]: + """Handle requests to list all API portal custom domains. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :return: An iterator like instance of either ApiPortalCustomDomainResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApiPortalCustomDomainResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ApiPortalCustomDomainResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_api_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_api_portals_operations.py new file mode 100644 index 00000000000..b7fb6b7ab7d --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_api_portals_operations.py @@ -0,0 +1,832 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, service_name: str, api_portal_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "apiPortalName": _SERIALIZER.url("api_portal_name", api_portal_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, api_portal_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "apiPortalName": _SERIALIZER.url("api_portal_name", api_portal_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, api_portal_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "apiPortalName": _SERIALIZER.url("api_portal_name", api_portal_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_validate_domain_request( + resource_group_name: str, service_name: str, api_portal_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "apiPortalName": _SERIALIZER.url("api_portal_name", api_portal_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ApiPortalsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`api_portals` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any + ) -> _models.ApiPortalResource: + """Get the API portal and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :return: ApiPortalResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApiPortalResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], + **kwargs: Any + ) -> _models.ApiPortalResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(api_portal_resource, (IOBase, bytes)): + _content = api_portal_resource + else: + _json = self._serialize.body(api_portal_resource, "ApiPortalResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApiPortalResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApiPortalResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + api_portal_resource: _models.ApiPortalResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApiPortalResource]: + """Create the default API portal or update the existing API portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param api_portal_resource: The API portal for the create or update operation. Required. + :type api_portal_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApiPortalResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + api_portal_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApiPortalResource]: + """Create the default API portal or update the existing API portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param api_portal_resource: The API portal for the create or update operation. Required. + :type api_portal_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApiPortalResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ApiPortalResource]: + """Create the default API portal or update the existing API portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param api_portal_resource: The API portal for the create or update operation. Is either a + ApiPortalResource type or a IO[bytes] type. Required. + :type api_portal_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource + or IO[bytes] + :return: An instance of LROPoller that returns either ApiPortalResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApiPortalResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + api_portal_resource=api_portal_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApiPortalResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ApiPortalResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ApiPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete the default API portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApiPortalResource"]: + """Handles requests to list all resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ApiPortalResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApiPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApiPortalResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ApiPortalResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @overload + def validate_domain( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + validate_payload: _models.CustomDomainValidatePayload, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the domains are valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param validate_payload: Custom domain payload to be validated. Required. + :type validate_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidatePayload + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate_domain( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + validate_payload: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the domains are valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param validate_payload: Custom domain payload to be validated. Required. + :type validate_payload: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def validate_domain( + self, + resource_group_name: str, + service_name: str, + api_portal_name: str, + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the domains are valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param api_portal_name: The name of API portal. Required. + :type api_portal_name: str + :param validate_payload: Custom domain payload to be validated. Is either a + CustomDomainValidatePayload type or a IO[bytes] type. Required. + :type validate_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomDomainValidateResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(validate_payload, (IOBase, bytes)): + _content = validate_payload + else: + _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") + + _request = build_validate_domain_request( + resource_group_name=resource_group_name, + service_name=service_name, + api_portal_name=api_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_apms_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_apms_operations.py new file mode 100644 index 00000000000..b7cf8f095f9 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_apms_operations.py @@ -0,0 +1,750 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, service_name: str, apm_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "apmName": _SERIALIZER.url("apm_name", apm_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, apm_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "apmName": _SERIALIZER.url("apm_name", apm_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, apm_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "apmName": _SERIALIZER.url("apm_name", apm_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_secret_keys_request( + resource_group_name: str, service_name: str, apm_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "apmName": _SERIALIZER.url("apm_name", apm_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ApmsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`apms` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.ApmResource"]: + """Get collection of APMs. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ApmResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApmResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ApmResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any) -> _models.ApmResource: + """Get the APM by name. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm_name: The name of the APM. Required. + :type apm_name: str + :return: ApmResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + apm_name=apm_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApmResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + apm_name: str, + apm_resource: Union[_models.ApmResource, IO[bytes]], + **kwargs: Any + ) -> _models.ApmResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(apm_resource, (IOBase, bytes)): + _content = apm_resource + else: + _json = self._serialize.body(apm_resource, "ApmResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + apm_name=apm_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApmResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApmResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + apm_name: str, + apm_resource: _models.ApmResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApmResource]: + """Create or update an APM. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm_name: The name of the APM. Required. + :type apm_name: str + :param apm_resource: Parameters for the create or update operation. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApmResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + apm_name: str, + apm_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApmResource]: + """Create or update an APM. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm_name: The name of the APM. Required. + :type apm_name: str + :param apm_resource: Parameters for the create or update operation. Required. + :type apm_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApmResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + apm_name: str, + apm_resource: Union[_models.ApmResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ApmResource]: + """Create or update an APM. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm_name: The name of the APM. Required. + :type apm_name: str + :param apm_resource: Parameters for the create or update operation. Is either a ApmResource + type or a IO[bytes] type. Required. + :type apm_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource or IO[bytes] + :return: An instance of LROPoller that returns either ApmResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + apm_name=apm_name, + apm_resource=apm_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApmResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ApmResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ApmResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + apm_name=apm_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Operation to delete an APM. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm_name: The name of the APM. Required. + :type apm_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + apm_name=apm_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_secret_keys( + self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any + ) -> _models.ApmSecretKeys: + """List keys of APM sensitive properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm_name: The name of the APM. Required. + :type apm_name: str + :return: ApmSecretKeys or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmSecretKeys + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None) + + _request = build_list_secret_keys_request( + resource_group_name=resource_group_name, + service_name=service_name, + apm_name=apm_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApmSecretKeys", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_application_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_application_accelerators_operations.py new file mode 100644 index 00000000000..38847350305 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_application_accelerators_operations.py @@ -0,0 +1,668 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, service_name: str, application_accelerator_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationAcceleratorName": _SERIALIZER.url( + "application_accelerator_name", application_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, application_accelerator_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationAcceleratorName": _SERIALIZER.url( + "application_accelerator_name", application_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, application_accelerator_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationAcceleratorName": _SERIALIZER.url( + "application_accelerator_name", application_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class ApplicationAcceleratorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`application_accelerators` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> Iterable["_models.ApplicationAcceleratorResource"]: + """Handle requests to list all application accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ApplicationAcceleratorResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApplicationAcceleratorResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any + ) -> _models.ApplicationAcceleratorResource: + """Get the application accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :return: ApplicationAcceleratorResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationAcceleratorResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(application_accelerator_resource, (IOBase, bytes)): + _content = application_accelerator_resource + else: + _json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + application_accelerator_resource: _models.ApplicationAcceleratorResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApplicationAcceleratorResource]: + """Create or update the application accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param application_accelerator_resource: The application accelerator for the create or update + operation. Required. + :type application_accelerator_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApplicationAcceleratorResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + application_accelerator_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApplicationAcceleratorResource]: + """Create or update the application accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param application_accelerator_resource: The application accelerator for the create or update + operation. Required. + :type application_accelerator_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApplicationAcceleratorResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ApplicationAcceleratorResource]: + """Create or update the application accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param application_accelerator_resource: The application accelerator for the create or update + operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required. + :type application_accelerator_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource or IO[bytes] + :return: An instance of LROPoller that returns either ApplicationAcceleratorResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + application_accelerator_resource=application_accelerator_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ApplicationAcceleratorResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ApplicationAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete the application accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_application_live_views_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_application_live_views_operations.py new file mode 100644 index 00000000000..dbb76ee2633 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_application_live_views_operations.py @@ -0,0 +1,666 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, service_name: str, application_live_view_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationLiveViewName": _SERIALIZER.url( + "application_live_view_name", application_live_view_name, "str", pattern=r"^[a-z][a-z0-9]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, application_live_view_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationLiveViewName": _SERIALIZER.url( + "application_live_view_name", application_live_view_name, "str", pattern=r"^[a-z][a-z0-9]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, application_live_view_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationLiveViewName": _SERIALIZER.url( + "application_live_view_name", application_live_view_name, "str", pattern=r"^[a-z][a-z0-9]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class ApplicationLiveViewsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`application_live_views` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> Iterable["_models.ApplicationLiveViewResource"]: + """Handles requests to list all resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ApplicationLiveViewResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApplicationLiveViewResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any + ) -> _models.ApplicationLiveViewResource: + """Get the Application Live and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_live_view_name: The name of Application Live View. Required. + :type application_live_view_name: str + :return: ApplicationLiveViewResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_live_view_name=application_live_view_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + application_live_view_name: str, + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], + **kwargs: Any + ) -> _models.ApplicationLiveViewResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(application_live_view_resource, (IOBase, bytes)): + _content = application_live_view_resource + else: + _json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_live_view_name=application_live_view_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_live_view_name: str, + application_live_view_resource: _models.ApplicationLiveViewResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApplicationLiveViewResource]: + """Create the default Application Live View or update the existing Application Live View. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_live_view_name: The name of Application Live View. Required. + :type application_live_view_name: str + :param application_live_view_resource: Parameters for the update operation. Required. + :type application_live_view_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApplicationLiveViewResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_live_view_name: str, + application_live_view_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ApplicationLiveViewResource]: + """Create the default Application Live View or update the existing Application Live View. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_live_view_name: The name of Application Live View. Required. + :type application_live_view_name: str + :param application_live_view_resource: Parameters for the update operation. Required. + :type application_live_view_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ApplicationLiveViewResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_live_view_name: str, + application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ApplicationLiveViewResource]: + """Create the default Application Live View or update the existing Application Live View. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_live_view_name: The name of Application Live View. Required. + :type application_live_view_name: str + :param application_live_view_resource: Parameters for the update operation. Is either a + ApplicationLiveViewResource type or a IO[bytes] type. Required. + :type application_live_view_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource or IO[bytes] + :return: An instance of LROPoller that returns either ApplicationLiveViewResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + application_live_view_name=application_live_view_name, + application_live_view_resource=application_live_view_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ApplicationLiveViewResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ApplicationLiveViewResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_live_view_name=application_live_view_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Disable the default Application Live View. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_live_view_name: The name of Application Live View. Required. + :type application_live_view_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + application_live_view_name=application_live_view_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_apps_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_apps_operations.py new file mode 100644 index 00000000000..3ffe2315baf --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_apps_operations.py @@ -0,0 +1,1437 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + service_name: str, + app_name: str, + subscription_id: str, + *, + sync_status: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if sync_status is not None: + _params["syncStatus"] = _SERIALIZER.query("sync_status", sync_status, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, app_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, app_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, service_name: str, app_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_resource_upload_url_request( + resource_group_name: str, service_name: str, app_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_set_active_deployments_request( + resource_group_name: str, service_name: str, app_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_validate_domain_request( + resource_group_name: str, service_name: str, app_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class AppsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`apps` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, + resource_group_name: str, + service_name: str, + app_name: str, + sync_status: Optional[str] = None, + **kwargs: Any + ) -> _models.AppResource: + """Get an App and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param sync_status: Indicates whether sync status. Default value is None. + :type sync_status: str + :return: AppResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + sync_status=sync_status, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AppResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: Union[_models.AppResource, IO[bytes]], + **kwargs: Any + ) -> _models.AppResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(app_resource, (IOBase, bytes)): + _content = app_resource + else: + _json = self._serialize.body(app_resource, "AppResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AppResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("AppResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("AppResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: _models.AppResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AppResource]: + """Create a new App or update an exiting App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param app_resource: Parameters for the create or update operation. Required. + :type app_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AppResource]: + """Create a new App or update an exiting App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param app_resource: Parameters for the create or update operation. Required. + :type app_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: Union[_models.AppResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AppResource]: + """Create a new App or update an exiting App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param app_resource: Parameters for the create or update operation. Is either a AppResource + type or a IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource or IO[bytes] + :return: An instance of LROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + app_resource=app_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AppResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AppResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Operation to delete an App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: Union[_models.AppResource, IO[bytes]], + **kwargs: Any + ) -> _models.AppResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(app_resource, (IOBase, bytes)): + _content = app_resource + else: + _json = self._serialize.body(app_resource, "AppResource") + + _request = build_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AppResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("AppResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: _models.AppResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AppResource]: + """Operation to update an exiting App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param app_resource: Parameters for the update operation. Required. + :type app_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AppResource]: + """Operation to update an exiting App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param app_resource: Parameters for the update operation. Required. + :type app_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + app_resource: Union[_models.AppResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AppResource]: + """Operation to update an exiting App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param app_resource: Parameters for the update operation. Is either a AppResource type or a + IO[bytes] type. Required. + :type app_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource or IO[bytes] + :return: An instance of LROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + app_resource=app_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AppResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AppResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.AppResource"]: + """Handles requests to list all resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either AppResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.AppResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AppResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_resource_upload_url( + self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any + ) -> _models.ResourceUploadDefinition: + """Get an resource upload URL for an App, which may be artifacts or source archive. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :return: ResourceUploadDefinition or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceUploadDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) + + _request = build_get_resource_upload_url_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _set_active_deployments_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], + **kwargs: Any + ) -> _models.AppResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(active_deployment_collection, (IOBase, bytes)): + _content = active_deployment_collection + else: + _json = self._serialize.body(active_deployment_collection, "ActiveDeploymentCollection") + + _request = build_set_active_deployments_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AppResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("AppResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_set_active_deployments( + self, + resource_group_name: str, + service_name: str, + app_name: str, + active_deployment_collection: _models.ActiveDeploymentCollection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AppResource]: + """Set existing Deployment under the app as active. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param active_deployment_collection: A list of Deployment name to be active. Required. + :type active_deployment_collection: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ActiveDeploymentCollection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_set_active_deployments( + self, + resource_group_name: str, + service_name: str, + app_name: str, + active_deployment_collection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AppResource]: + """Set existing Deployment under the app as active. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param active_deployment_collection: A list of Deployment name to be active. Required. + :type active_deployment_collection: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_set_active_deployments( + self, + resource_group_name: str, + service_name: str, + app_name: str, + active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AppResource]: + """Set existing Deployment under the app as active. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param active_deployment_collection: A list of Deployment name to be active. Is either a + ActiveDeploymentCollection type or a IO[bytes] type. Required. + :type active_deployment_collection: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ActiveDeploymentCollection or IO[bytes] + :return: An instance of LROPoller that returns either AppResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.AppResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AppResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._set_active_deployments_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + active_deployment_collection=active_deployment_collection, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AppResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AppResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AppResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def validate_domain( + self, + resource_group_name: str, + service_name: str, + app_name: str, + validate_payload: _models.CustomDomainValidatePayload, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the resource name is valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param validate_payload: Custom domain payload to be validated. Required. + :type validate_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidatePayload + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate_domain( + self, + resource_group_name: str, + service_name: str, + app_name: str, + validate_payload: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the resource name is valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param validate_payload: Custom domain payload to be validated. Required. + :type validate_payload: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def validate_domain( + self, + resource_group_name: str, + service_name: str, + app_name: str, + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the resource name is valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param validate_payload: Custom domain payload to be validated. Is either a + CustomDomainValidatePayload type or a IO[bytes] type. Required. + :type validate_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomDomainValidateResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(validate_payload, (IOBase, bytes)): + _content = validate_payload + else: + _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") + + _request = build_validate_domain_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_bindings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_bindings_operations.py new file mode 100644 index 00000000000..15f39fde5a7 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_bindings_operations.py @@ -0,0 +1,944 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, service_name: str, app_name: str, binding_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "bindingName": _SERIALIZER.url("binding_name", binding_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, app_name: str, binding_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "bindingName": _SERIALIZER.url("binding_name", binding_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, app_name: str, binding_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "bindingName": _SERIALIZER.url("binding_name", binding_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, service_name: str, app_name: str, binding_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "bindingName": _SERIALIZER.url("binding_name", binding_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, service_name: str, app_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class BindingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`bindings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any + ) -> _models.BindingResource: + """Get a Binding and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :return: BindingResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BindingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: Union[_models.BindingResource, IO[bytes]], + **kwargs: Any + ) -> _models.BindingResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(binding_resource, (IOBase, bytes)): + _content = binding_resource + else: + _json = self._serialize.body(binding_resource, "BindingResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BindingResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BindingResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("BindingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: _models.BindingResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BindingResource]: + """Create a new Binding or update an exiting Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :param binding_resource: Parameters for the create or update operation. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BindingResource]: + """Create a new Binding or update an exiting Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :param binding_resource: Parameters for the create or update operation. Required. + :type binding_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: Union[_models.BindingResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.BindingResource]: + """Create a new Binding or update an exiting Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :param binding_resource: Parameters for the create or update operation. Is either a + BindingResource type or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource or + IO[bytes] + :return: An instance of LROPoller that returns either BindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + binding_resource=binding_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BindingResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BindingResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Operation to delete a Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: Union[_models.BindingResource, IO[bytes]], + **kwargs: Any + ) -> _models.BindingResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(binding_resource, (IOBase, bytes)): + _content = binding_resource + else: + _json = self._serialize.body(binding_resource, "BindingResource") + + _request = build_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BindingResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("BindingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: _models.BindingResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BindingResource]: + """Operation to update an exiting Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :param binding_resource: Parameters for the update operation. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BindingResource]: + """Operation to update an exiting Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :param binding_resource: Parameters for the update operation. Required. + :type binding_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + binding_name: str, + binding_resource: Union[_models.BindingResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.BindingResource]: + """Operation to update an exiting Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param binding_name: The name of the Binding resource. Required. + :type binding_name: str + :param binding_resource: Parameters for the update operation. Is either a BindingResource type + or a IO[bytes] type. Required. + :type binding_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource or + IO[bytes] + :return: An instance of LROPoller that returns either BindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BindingResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + binding_resource=binding_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BindingResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BindingResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any + ) -> Iterable["_models.BindingResource"]: + """Handles requests to list all resources in an App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :return: An iterator like instance of either BindingResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.BindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BindingResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BindingResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_build_service_agent_pool_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_build_service_agent_pool_operations.py new file mode 100644 index 00000000000..3d7c66acf26 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_build_service_agent_pool_operations.py @@ -0,0 +1,553 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request( + resource_group_name: str, service_name: str, build_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + agent_pool_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_put_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + agent_pool_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +class BuildServiceAgentPoolOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`build_service_agent_pool` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any + ) -> Iterable["_models.BuildServiceAgentPoolResource"]: + """List build service agent pool. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :return: An iterator like instance of either BuildServiceAgentPoolResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildServiceAgentPoolResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BuildServiceAgentPoolResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, build_service_name: str, agent_pool_name: str, **kwargs: Any + ) -> _models.BuildServiceAgentPoolResource: + """Get build service agent pool. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param agent_pool_name: The name of the build service agent pool resource. Required. + :type agent_pool_name: str + :return: BuildServiceAgentPoolResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _update_put_initial( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + agent_pool_name: str, + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], + **kwargs: Any + ) -> _models.BuildServiceAgentPoolResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(agent_pool_resource, (IOBase, bytes)): + _content = agent_pool_resource + else: + _json = self._serialize.body(agent_pool_resource, "BuildServiceAgentPoolResource") + + _request = build_update_put_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + agent_pool_name: str, + agent_pool_resource: _models.BuildServiceAgentPoolResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BuildServiceAgentPoolResource]: + """Create or update build service agent pool. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param agent_pool_name: The name of the build service agent pool resource. Required. + :type agent_pool_name: str + :param agent_pool_resource: Parameters for the update operation. Required. + :type agent_pool_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + agent_pool_name: str, + agent_pool_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BuildServiceAgentPoolResource]: + """Create or update build service agent pool. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param agent_pool_name: The name of the build service agent pool resource. Required. + :type agent_pool_name: str + :param agent_pool_resource: Parameters for the update operation. Required. + :type agent_pool_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + agent_pool_name: str, + agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.BuildServiceAgentPoolResource]: + """Create or update build service agent pool. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param agent_pool_name: The name of the build service agent pool resource. Required. + :type agent_pool_name: str + :param agent_pool_resource: Parameters for the update operation. Is either a + BuildServiceAgentPoolResource type or a IO[bytes] type. Required. + :type agent_pool_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource or IO[bytes] + :return: An instance of LROPoller that returns either BuildServiceAgentPoolResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildServiceAgentPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuildServiceAgentPoolResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_put_initial( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + agent_pool_name=agent_pool_name, + agent_pool_resource=agent_pool_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BuildServiceAgentPoolResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BuildServiceAgentPoolResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BuildServiceAgentPoolResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_build_service_builder_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_build_service_builder_operations.py new file mode 100644 index 00000000000..dd31b2e6841 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_build_service_builder_operations.py @@ -0,0 +1,801 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "builderName": _SERIALIZER.url("builder_name", builder_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "builderName": _SERIALIZER.url("builder_name", builder_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "builderName": _SERIALIZER.url("builder_name", builder_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, service_name: str, build_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_deployments_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "builderName": _SERIALIZER.url("builder_name", builder_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class BuildServiceBuilderOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`build_service_builder` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any + ) -> _models.BuilderResource: + """Get a KPack builder. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :return: BuilderResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BuilderResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + builder_resource: Union[_models.BuilderResource, IO[bytes]], + **kwargs: Any + ) -> _models.BuilderResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(builder_resource, (IOBase, bytes)): + _content = builder_resource + else: + _json = self._serialize.body(builder_resource, "BuilderResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BuilderResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BuilderResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + builder_resource: _models.BuilderResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BuilderResource]: + """Create or update a KPack builder. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param builder_resource: The target builder for the create or update operation. Required. + :type builder_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BuilderResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + builder_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BuilderResource]: + """Create or update a KPack builder. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param builder_resource: The target builder for the create or update operation. Required. + :type builder_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BuilderResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + builder_resource: Union[_models.BuilderResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.BuilderResource]: + """Create or update a KPack builder. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param builder_resource: The target builder for the create or update operation. Is either a + BuilderResource type or a IO[bytes] type. Required. + :type builder_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource or + IO[bytes] + :return: An instance of LROPoller that returns either BuilderResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + builder_resource=builder_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BuilderResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BuilderResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BuilderResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a KPack builder. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any + ) -> Iterable["_models.BuilderResource"]: + """List KPack builders result. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :return: An iterator like instance of either BuilderResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuilderResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuilderResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BuilderResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_deployments( + self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any + ) -> _models.DeploymentList: + """List deployments that are using the builder. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :return: DeploymentList or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.DeploymentList] = kwargs.pop("cls", None) + + _request = build_list_deployments_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DeploymentList", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_build_service_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_build_service_operations.py new file mode 100644 index 00000000000..bcd877ea9f3 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_build_service_operations.py @@ -0,0 +1,1953 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_build_services_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_build_service_request( + resource_group_name: str, service_name: str, build_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, build_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_builds_request( + resource_group_name: str, service_name: str, build_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_build_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "buildName": _SERIALIZER.url("build_name", build_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_build_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "buildName": _SERIALIZER.url("build_name", build_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_build_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "buildName": _SERIALIZER.url("build_name", build_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_build_results_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "buildName": _SERIALIZER.url("build_name", build_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_build_result_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + build_result_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "buildName": _SERIALIZER.url("build_name", build_name, "str"), + "buildResultName": _SERIALIZER.url("build_result_name", build_result_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_build_result_log_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + build_result_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "buildName": _SERIALIZER.url("build_name", build_name, "str"), + "buildResultName": _SERIALIZER.url("build_result_name", build_result_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_resource_upload_url_request( + resource_group_name: str, service_name: str, build_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_supported_buildpacks_request( + resource_group_name: str, service_name: str, build_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_supported_buildpack_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + buildpack_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "buildpackName": _SERIALIZER.url("buildpack_name", buildpack_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_supported_stacks_request( + resource_group_name: str, service_name: str, build_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_supported_stack_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + stack_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "stackName": _SERIALIZER.url("stack_name", stack_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class BuildServiceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`build_service` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list_build_services( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> Iterable["_models.BuildService"]: + """List build services resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either BuildService or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildServiceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_build_services_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BuildServiceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_build_service( + self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any + ) -> _models.BuildService: + """Get a build service resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :return: BuildService or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) + + _request = build_get_build_service_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BuildService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_service: Union[_models.BuildService, IO[bytes]], + **kwargs: Any + ) -> _models.BuildService: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(build_service, (IOBase, bytes)): + _content = build_service + else: + _json = self._serialize.body(build_service, "BuildService") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BuildService", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BuildService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_service: _models.BuildService, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BuildService]: + """Create a build service resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_service: Parameters for the create operation. Required. + :type build_service: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BuildService or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_service: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BuildService]: + """Create a build service resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_service: Parameters for the create operation. Required. + :type build_service: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BuildService or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_service: Union[_models.BuildService, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.BuildService]: + """Create a build service resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_service: Parameters for the create operation. Is either a BuildService type or a + IO[bytes] type. Required. + :type build_service: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService or + IO[bytes] + :return: An instance of LROPoller that returns either BuildService or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuildService] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_service=build_service, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BuildService", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BuildService].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BuildService]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_builds( + self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any + ) -> Iterable["_models.Build"]: + """List KPack builds. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :return: An iterator like instance of either Build or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.Build] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_builds_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BuildCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_build( + self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any + ) -> _models.Build: + """Get a KPack build. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :return: Build or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Build + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.Build] = kwargs.pop("cls", None) + + _request = build_get_build_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_name=build_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Build", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update_build( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + build: _models.Build, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Build: + """Create or update a KPack build. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :param build: Parameters for the create or update operation. Required. + :type build: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Build + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Build or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Build + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update_build( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + build: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Build: + """Create or update a KPack build. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :param build: Parameters for the create or update operation. Required. + :type build: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Build or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Build + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update_build( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + build: Union[_models.Build, IO[bytes]], + **kwargs: Any + ) -> _models.Build: + """Create or update a KPack build. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :param build: Parameters for the create or update operation. Is either a Build type or a + IO[bytes] type. Required. + :type build: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Build or IO[bytes] + :return: Build or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.Build + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Build] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(build, (IOBase, bytes)): + _content = build + else: + _json = self._serialize.body(build, "Build") + + _request = build_create_or_update_build_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_name=build_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Build", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Build", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_build_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_build_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_name=build_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete_build( + self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any + ) -> LROPoller[None]: + """delete a KPack build. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_build_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_name=build_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_build_results( + self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any + ) -> Iterable["_models.BuildResult"]: + """List KPack build results. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :return: An iterator like instance of either BuildResult or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildResultCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_build_results_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_name=build_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BuildResultCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_build_result( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + build_result_name: str, + **kwargs: Any + ) -> _models.BuildResult: + """Get a KPack build result. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :param build_result_name: The name of the build result resource. Required. + :type build_result_name: str + :return: BuildResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildResult] = kwargs.pop("cls", None) + + _request = build_get_build_result_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_name=build_name, + build_result_name=build_result_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BuildResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_build_result_log( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + build_name: str, + build_result_name: str, + **kwargs: Any + ) -> _models.BuildResultLog: + """Get a KPack build result log download URL. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param build_name: The name of the build resource. Required. + :type build_name: str + :param build_result_name: The name of the build result resource. Required. + :type build_result_name: str + :return: BuildResultLog or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildResultLog + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildResultLog] = kwargs.pop("cls", None) + + _request = build_get_build_result_log_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + build_name=build_name, + build_result_name=build_result_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BuildResultLog", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_resource_upload_url( + self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any + ) -> _models.ResourceUploadDefinition: + """Get an resource upload URL for build service, which may be artifacts or source archive. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :return: ResourceUploadDefinition or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceUploadDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ResourceUploadDefinition] = kwargs.pop("cls", None) + + _request = build_get_resource_upload_url_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ResourceUploadDefinition", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_supported_buildpacks( + self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any + ) -> _models.SupportedBuildpacksCollection: + """Get all supported buildpacks. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :return: SupportedBuildpacksCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedBuildpacksCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.SupportedBuildpacksCollection] = kwargs.pop("cls", None) + + _request = build_list_supported_buildpacks_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SupportedBuildpacksCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_supported_buildpack( + self, resource_group_name: str, service_name: str, build_service_name: str, buildpack_name: str, **kwargs: Any + ) -> _models.SupportedBuildpackResource: + """Get the supported buildpack resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param buildpack_name: The name of the buildpack resource. Required. + :type buildpack_name: str + :return: SupportedBuildpackResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedBuildpackResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.SupportedBuildpackResource] = kwargs.pop("cls", None) + + _request = build_get_supported_buildpack_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + buildpack_name=buildpack_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SupportedBuildpackResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_supported_stacks( + self, resource_group_name: str, service_name: str, build_service_name: str, **kwargs: Any + ) -> _models.SupportedStacksCollection: + """Get all supported stacks. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :return: SupportedStacksCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedStacksCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.SupportedStacksCollection] = kwargs.pop("cls", None) + + _request = build_list_supported_stacks_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SupportedStacksCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_supported_stack( + self, resource_group_name: str, service_name: str, build_service_name: str, stack_name: str, **kwargs: Any + ) -> _models.SupportedStackResource: + """Get the supported stack resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param stack_name: The name of the stack resource. Required. + :type stack_name: str + :return: SupportedStackResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedStackResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.SupportedStackResource] = kwargs.pop("cls", None) + + _request = build_get_supported_stack_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + stack_name=stack_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SupportedStackResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_buildpack_binding_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_buildpack_binding_operations.py new file mode 100644 index 00000000000..586535a8503 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_buildpack_binding_operations.py @@ -0,0 +1,873 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_for_cluster_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "builderName": _SERIALIZER.url("builder_name", builder_name, "str"), + "buildpackBindingName": _SERIALIZER.url("buildpack_binding_name", buildpack_binding_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "builderName": _SERIALIZER.url("builder_name", builder_name, "str"), + "buildpackBindingName": _SERIALIZER.url("buildpack_binding_name", buildpack_binding_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "builderName": _SERIALIZER.url("builder_name", builder_name, "str"), + "buildpackBindingName": _SERIALIZER.url("buildpack_binding_name", buildpack_binding_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, "str"), + "builderName": _SERIALIZER.url("builder_name", builder_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class BuildpackBindingOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`buildpack_binding` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list_for_cluster( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> Iterable["_models.BuildpackBindingResource"]: + """Get collection of buildpack bindings under all builders. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either BuildpackBindingResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildpackBindingResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_for_cluster_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + **kwargs: Any + ) -> _models.BuildpackBindingResource: + """Get a buildpack binding by name. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. + :type buildpack_binding_name: str + :return: BuildpackBindingResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + buildpack_binding_name=buildpack_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], + **kwargs: Any + ) -> _models.BuildpackBindingResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(buildpack_binding, (IOBase, bytes)): + _content = buildpack_binding + else: + _json = self._serialize.body(buildpack_binding, "BuildpackBindingResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + buildpack_binding_name=buildpack_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + buildpack_binding: _models.BuildpackBindingResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BuildpackBindingResource]: + """Create or update a buildpack binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. + :type buildpack_binding_name: str + :param buildpack_binding: The target buildpack binding for the create or update operation. + Required. + :type buildpack_binding: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + buildpack_binding: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BuildpackBindingResource]: + """Create or update a buildpack binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. + :type buildpack_binding_name: str + :param buildpack_binding: The target buildpack binding for the create or update operation. + Required. + :type buildpack_binding: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.BuildpackBindingResource]: + """Create or update a buildpack binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. + :type buildpack_binding_name: str + :param buildpack_binding: The target buildpack binding for the create or update operation. Is + either a BuildpackBindingResource type or a IO[bytes] type. Required. + :type buildpack_binding: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource or IO[bytes] + :return: An instance of LROPoller that returns either BuildpackBindingResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BuildpackBindingResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + buildpack_binding_name=buildpack_binding_name, + buildpack_binding=buildpack_binding, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("BuildpackBindingResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BuildpackBindingResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BuildpackBindingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + buildpack_binding_name=buildpack_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + builder_name: str, + buildpack_binding_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Operation to delete a Buildpack Binding. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :param buildpack_binding_name: The name of the Buildpack Binding Name. Required. + :type buildpack_binding_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + buildpack_binding_name=buildpack_binding_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any + ) -> Iterable["_models.BuildpackBindingResource"]: + """Handles requests to list all buildpack bindings in a builder. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param build_service_name: The name of the build service resource. Required. + :type build_service_name: str + :param builder_name: The name of the builder resource. Required. + :type builder_name: str + :return: An iterator like instance of either BuildpackBindingResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.BuildpackBindingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.BuildpackBindingResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + build_service_name=build_service_name, + builder_name=builder_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BuildpackBindingResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_certificates_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_certificates_operations.py new file mode 100644 index 00000000000..feee0faf523 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_certificates_operations.py @@ -0,0 +1,658 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, service_name: str, certificate_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, certificate_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, certificate_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class CertificatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`certificates` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any + ) -> _models.CertificateResource: + """Get the certificate resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param certificate_name: The name of the certificate resource. Required. + :type certificate_name: str + :return: CertificateResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + certificate_name=certificate_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CertificateResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + certificate_name: str, + certificate_resource: Union[_models.CertificateResource, IO[bytes]], + **kwargs: Any + ) -> _models.CertificateResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(certificate_resource, (IOBase, bytes)): + _content = certificate_resource + else: + _json = self._serialize.body(certificate_resource, "CertificateResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + certificate_name=certificate_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("CertificateResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("CertificateResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("CertificateResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + certificate_name: str, + certificate_resource: _models.CertificateResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CertificateResource]: + """Create or update certificate resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param certificate_name: The name of the certificate resource. Required. + :type certificate_name: str + :param certificate_resource: Parameters for the create or update operation. Required. + :type certificate_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either CertificateResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + certificate_name: str, + certificate_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CertificateResource]: + """Create or update certificate resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param certificate_name: The name of the certificate resource. Required. + :type certificate_name: str + :param certificate_resource: Parameters for the create or update operation. Required. + :type certificate_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either CertificateResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + certificate_name: str, + certificate_resource: Union[_models.CertificateResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CertificateResource]: + """Create or update certificate resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param certificate_name: The name of the certificate resource. Required. + :type certificate_name: str + :param certificate_resource: Parameters for the create or update operation. Is either a + CertificateResource type or a IO[bytes] type. Required. + :type certificate_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource or IO[bytes] + :return: An instance of LROPoller that returns either CertificateResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CertificateResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + certificate_name=certificate_name, + certificate_resource=certificate_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CertificateResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CertificateResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CertificateResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + certificate_name=certificate_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete the certificate resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param certificate_name: The name of the certificate resource. Required. + :type certificate_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + certificate_name=certificate_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> Iterable["_models.CertificateResource"]: + """List all the certificates of one user. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either CertificateResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.CertificateResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.CertificateResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("CertificateResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_config_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_config_servers_operations.py new file mode 100644 index 00000000000..5422945892e --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_config_servers_operations.py @@ -0,0 +1,1102 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_put_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_patch_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_validate_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ConfigServersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`config_servers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.ConfigServerResource: + """Get the config server and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: ConfigServerResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConfigServerResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _update_put_initial( + self, + resource_group_name: str, + service_name: str, + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], + **kwargs: Any + ) -> _models.ConfigServerResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(config_server_resource, (IOBase, bytes)): + _content = config_server_resource + else: + _json = self._serialize.body(config_server_resource, "ConfigServerResource") + + _request = build_update_put_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConfigServerResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ConfigServerResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + config_server_resource: _models.ConfigServerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigServerResource]: + """Update the config server. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_resource: Parameters for the update operation. Required. + :type config_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConfigServerResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + config_server_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigServerResource]: + """Update the config server. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_resource: Parameters for the update operation. Required. + :type config_server_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConfigServerResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ConfigServerResource]: + """Update the config server. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_resource: Parameters for the update operation. Is either a + ConfigServerResource type or a IO[bytes] type. Required. + :type config_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource or IO[bytes] + :return: An instance of LROPoller that returns either ConfigServerResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_put_initial( + resource_group_name=resource_group_name, + service_name=service_name, + config_server_resource=config_server_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigServerResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ConfigServerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_patch_initial( + self, + resource_group_name: str, + service_name: str, + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], + **kwargs: Any + ) -> _models.ConfigServerResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(config_server_resource, (IOBase, bytes)): + _content = config_server_resource + else: + _json = self._serialize.body(config_server_resource, "ConfigServerResource") + + _request = build_update_patch_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConfigServerResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ConfigServerResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + config_server_resource: _models.ConfigServerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigServerResource]: + """Update the config server. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_resource: Parameters for the update operation. Required. + :type config_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConfigServerResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + config_server_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigServerResource]: + """Update the config server. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_resource: Parameters for the update operation. Required. + :type config_server_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConfigServerResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ConfigServerResource]: + """Update the config server. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_resource: Parameters for the update operation. Is either a + ConfigServerResource type or a IO[bytes] type. Required. + :type config_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource or IO[bytes] + :return: An instance of LROPoller that returns either ConfigServerResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_patch_initial( + resource_group_name=resource_group_name, + service_name=service_name, + config_server_resource=config_server_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigServerResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ConfigServerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ConfigServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: + """Disable the default Config Server, only available in Enterprise Plan. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> Iterable["_models.ConfigServerResource"]: + """Handles requests to list all config server resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ConfigServerResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ConfigServerResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ConfigServerResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _validate_initial( + self, + resource_group_name: str, + service_name: str, + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], + **kwargs: Any + ) -> _models.ConfigServerSettingsValidateResult: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigServerSettingsValidateResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(config_server_settings, (IOBase, bytes)): + _content = config_server_settings + else: + _json = self._serialize.body(config_server_settings, "ConfigServerSettings") + + _request = build_validate_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_validate( + self, + resource_group_name: str, + service_name: str, + config_server_settings: _models.ConfigServerSettings, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: + """Check if the config server settings are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_settings: Config server settings to be validated. Required. + :type config_server_settings: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerSettings + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_validate( + self, + resource_group_name: str, + service_name: str, + config_server_settings: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: + """Check if the config server settings are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_settings: Config server settings to be validated. Required. + :type config_server_settings: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_validate( + self, + resource_group_name: str, + service_name: str, + config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ConfigServerSettingsValidateResult]: + """Check if the config server settings are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param config_server_settings: Config server settings to be validated. Is either a + ConfigServerSettings type or a IO[bytes] type. Required. + :type config_server_settings: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerSettings or IO[bytes] + :return: An instance of LROPoller that returns either ConfigServerSettingsValidateResult or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigServerSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigServerSettingsValidateResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._validate_initial( + resource_group_name=resource_group_name, + service_name=service_name, + config_server_settings=config_server_settings, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ConfigServerSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_configuration_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_configuration_services_operations.py new file mode 100644 index 00000000000..11bb79c666d --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_configuration_services_operations.py @@ -0,0 +1,1170 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, service_name: str, configuration_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "configurationServiceName": _SERIALIZER.url( + "configuration_service_name", configuration_service_name, "str", pattern=r"^[a-z][a-z0-9]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, configuration_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "configurationServiceName": _SERIALIZER.url( + "configuration_service_name", configuration_service_name, "str", pattern=r"^[a-z][a-z0-9]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, configuration_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "configurationServiceName": _SERIALIZER.url( + "configuration_service_name", configuration_service_name, "str", pattern=r"^[a-z][a-z0-9]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_validate_request( + resource_group_name: str, service_name: str, configuration_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "configurationServiceName": _SERIALIZER.url( + "configuration_service_name", configuration_service_name, "str", pattern=r"^[a-z][a-z0-9]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_validate_resource_request( + resource_group_name: str, service_name: str, configuration_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "configurationServiceName": _SERIALIZER.url( + "configuration_service_name", configuration_service_name, "str", pattern=r"^[a-z][a-z0-9]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ConfigurationServicesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`configuration_services` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any + ) -> _models.ConfigurationServiceResource: + """Get the Application Configuration Service and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :return: ConfigurationServiceResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], + **kwargs: Any + ) -> _models.ConfigurationServiceResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(configuration_service_resource, (IOBase, bytes)): + _content = configuration_service_resource + else: + _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: _models.ConfigurationServiceResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigurationServiceResource]: + """Create the default Application Configuration Service or update the existing Application + Configuration Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param configuration_service_resource: Parameters for the update operation. Required. + :type configuration_service_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConfigurationServiceResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigurationServiceResource]: + """Create the default Application Configuration Service or update the existing Application + Configuration Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param configuration_service_resource: Parameters for the update operation. Required. + :type configuration_service_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ConfigurationServiceResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ConfigurationServiceResource]: + """Create the default Application Configuration Service or update the existing Application + Configuration Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param configuration_service_resource: Parameters for the update operation. Is either a + ConfigurationServiceResource type or a IO[bytes] type. Required. + :type configuration_service_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource or IO[bytes] + :return: An instance of LROPoller that returns either ConfigurationServiceResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationServiceResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + configuration_service_resource=configuration_service_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigurationServiceResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ConfigurationServiceResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ConfigurationServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Disable the default Application Configuration Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> Iterable["_models.ConfigurationServiceResource"]: + """Handles requests to list all resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ConfigurationServiceResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ConfigurationServiceResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ConfigurationServiceResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _validate_initial( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], + **kwargs: Any + ) -> _models.ConfigurationServiceSettingsValidateResult: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationServiceSettingsValidateResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(settings, (IOBase, bytes)): + _content = settings + else: + _json = self._serialize.body(settings, "ConfigurationServiceSettings") + + _request = build_validate_request( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_validate( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + settings: _models.ConfigurationServiceSettings, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: + """Check if the Application Configuration Service settings are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param settings: Application Configuration Service settings to be validated. Required. + :type settings: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettings + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either + ConfigurationServiceSettingsValidateResult or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_validate( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + settings: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: + """Check if the Application Configuration Service settings are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param settings: Application Configuration Service settings to be validated. Required. + :type settings: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either + ConfigurationServiceSettingsValidateResult or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_validate( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: + """Check if the Application Configuration Service settings are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param settings: Application Configuration Service settings to be validated. Is either a + ConfigurationServiceSettings type or a IO[bytes] type. Required. + :type settings: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettings + or IO[bytes] + :return: An instance of LROPoller that returns either + ConfigurationServiceSettingsValidateResult or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationServiceSettingsValidateResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._validate_initial( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + settings=settings, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _validate_resource_initial( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ConfigurationServiceSettingsValidateResult]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ConfigurationServiceSettingsValidateResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(configuration_service_resource, (IOBase, bytes)): + _content = configuration_service_resource + else: + _json = self._serialize.body(configuration_service_resource, "ConfigurationServiceResource") + + _request = build_validate_resource_request( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_validate_resource( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: _models.ConfigurationServiceResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: + """Check if the Application Configuration Service resource is valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param configuration_service_resource: Application Configuration Service resource to be + validated. Required. + :type configuration_service_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either + ConfigurationServiceSettingsValidateResult or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_validate_resource( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: + """Check if the Application Configuration Service resource is valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param configuration_service_resource: Application Configuration Service resource to be + validated. Required. + :type configuration_service_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either + ConfigurationServiceSettingsValidateResult or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_validate_resource( + self, + resource_group_name: str, + service_name: str, + configuration_service_name: str, + configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ConfigurationServiceSettingsValidateResult]: + """Check if the Application Configuration Service resource is valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param configuration_service_name: The name of Application Configuration Service. Required. + :type configuration_service_name: str + :param configuration_service_resource: Application Configuration Service resource to be + validated. Is either a ConfigurationServiceResource type or a IO[bytes] type. Required. + :type configuration_service_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceResource or IO[bytes] + :return: An instance of LROPoller that returns either + ConfigurationServiceSettingsValidateResult or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ConfigurationServiceSettingsValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationServiceSettingsValidateResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._validate_resource_initial( + resource_group_name=resource_group_name, + service_name=service_name, + configuration_service_name=configuration_service_name, + configuration_service_resource=configuration_service_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigurationServiceSettingsValidateResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ConfigurationServiceSettingsValidateResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ConfigurationServiceSettingsValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_container_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_container_registries_operations.py new file mode 100644 index 00000000000..0704efda5d7 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_container_registries_operations.py @@ -0,0 +1,923 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, service_name: str, container_registry_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "containerRegistryName": _SERIALIZER.url( + "container_registry_name", container_registry_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, container_registry_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "containerRegistryName": _SERIALIZER.url( + "container_registry_name", container_registry_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, container_registry_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "containerRegistryName": _SERIALIZER.url( + "container_registry_name", container_registry_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_validate_request( + resource_group_name: str, service_name: str, container_registry_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "containerRegistryName": _SERIALIZER.url( + "container_registry_name", container_registry_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ContainerRegistriesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`container_registries` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> Iterable["_models.ContainerRegistryResource"]: + """List container registries resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ContainerRegistryResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ContainerRegistryResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any + ) -> _models.ContainerRegistryResource: + """Get the container registries resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :return: ContainerRegistryResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + container_registry_name=container_registry_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], + **kwargs: Any + ) -> _models.ContainerRegistryResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(container_registry_resource, (IOBase, bytes)): + _content = container_registry_resource + else: + _json = self._serialize.body(container_registry_resource, "ContainerRegistryResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + container_registry_name=container_registry_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_resource: _models.ContainerRegistryResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ContainerRegistryResource]: + """Create or update container registry resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :param container_registry_resource: Parameters for the create or update operation. Required. + :type container_registry_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ContainerRegistryResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ContainerRegistryResource]: + """Create or update container registry resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :param container_registry_resource: Parameters for the create or update operation. Required. + :type container_registry_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ContainerRegistryResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ContainerRegistryResource]: + """Create or update container registry resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :param container_registry_resource: Parameters for the create or update operation. Is either a + ContainerRegistryResource type or a IO[bytes] type. Required. + :type container_registry_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource or IO[bytes] + :return: An instance of LROPoller that returns either ContainerRegistryResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + container_registry_name=container_registry_name, + container_registry_resource=container_registry_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ContainerRegistryResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ContainerRegistryResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ContainerRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + container_registry_name=container_registry_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a container registry resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + container_registry_name=container_registry_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _validate_initial( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.ContainerRegistryValidateResult]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ContainerRegistryValidateResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(container_registry_properties, (IOBase, bytes)): + _content = container_registry_properties + else: + _json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties") + + _request = build_validate_request( + resource_group_name=resource_group_name, + service_name=service_name, + container_registry_name=container_registry_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_validate( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_properties: _models.ContainerRegistryProperties, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ContainerRegistryValidateResult]: + """Check if the container registry properties are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :param container_registry_properties: Parameters for the validate operation. Required. + :type container_registry_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryProperties + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ContainerRegistryValidateResult or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_validate( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ContainerRegistryValidateResult]: + """Check if the container registry properties are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :param container_registry_properties: Parameters for the validate operation. Required. + :type container_registry_properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ContainerRegistryValidateResult or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_validate( + self, + resource_group_name: str, + service_name: str, + container_registry_name: str, + container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ContainerRegistryValidateResult]: + """Check if the container registry properties are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param container_registry_name: The name of the container registry. Required. + :type container_registry_name: str + :param container_registry_properties: Parameters for the validate operation. Is either a + ContainerRegistryProperties type or a IO[bytes] type. Required. + :type container_registry_properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryProperties or IO[bytes] + :return: An instance of LROPoller that returns either ContainerRegistryValidateResult or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ContainerRegistryValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ContainerRegistryValidateResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._validate_initial( + resource_group_name=resource_group_name, + service_name=service_name, + container_registry_name=container_registry_name, + container_registry_properties=container_registry_properties, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ContainerRegistryValidateResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ContainerRegistryValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_custom_domains_operations.py new file mode 100644 index 00000000000..418e45fdf98 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_custom_domains_operations.py @@ -0,0 +1,945 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, service_name: str, app_name: str, domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "domainName": _SERIALIZER.url("domain_name", domain_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, app_name: str, domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "domainName": _SERIALIZER.url("domain_name", domain_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, app_name: str, domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "domainName": _SERIALIZER.url("domain_name", domain_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, service_name: str, app_name: str, domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "domainName": _SERIALIZER.url("domain_name", domain_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, service_name: str, app_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class CustomDomainsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`custom_domains` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any + ) -> _models.CustomDomainResource: + """Get the custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :return: CustomDomainResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> _models.CustomDomainResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(domain_resource, (IOBase, bytes)): + _content = domain_resource + else: + _json = self._serialize.body(domain_resource, "CustomDomainResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: _models.CustomDomainResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CustomDomainResource]: + """Create or update custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :param domain_resource: Parameters for the create or update operation. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either CustomDomainResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CustomDomainResource]: + """Create or update custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :param domain_resource: Parameters for the create or update operation. Required. + :type domain_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either CustomDomainResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CustomDomainResource]: + """Create or update custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :param domain_resource: Parameters for the create or update operation. Is either a + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource + or IO[bytes] + :return: An instance of LROPoller that returns either CustomDomainResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + domain_resource=domain_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CustomDomainResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete the custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> _models.CustomDomainResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(domain_resource, (IOBase, bytes)): + _content = domain_resource + else: + _json = self._serialize.body(domain_resource, "CustomDomainResource") + + _request = build_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: _models.CustomDomainResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CustomDomainResource]: + """Update custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :param domain_resource: Parameters for the create or update operation. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either CustomDomainResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CustomDomainResource]: + """Update custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :param domain_resource: Parameters for the create or update operation. Required. + :type domain_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either CustomDomainResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + domain_name: str, + domain_resource: Union[_models.CustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CustomDomainResource]: + """Update custom domain of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param domain_name: The name of the custom domain resource. Required. + :type domain_name: str + :param domain_resource: Parameters for the create or update operation. Is either a + CustomDomainResource type or a IO[bytes] type. Required. + :type domain_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource + or IO[bytes] + :return: An instance of LROPoller that returns either CustomDomainResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + domain_resource=domain_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CustomDomainResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CustomDomainResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any + ) -> Iterable["_models.CustomDomainResource"]: + """List the custom domains of one lifecycle application. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :return: An iterator like instance of either CustomDomainResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.CustomDomainResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_customized_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_customized_accelerators_operations.py new file mode 100644 index 00000000000..503f0767e60 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_customized_accelerators_operations.py @@ -0,0 +1,1005 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request( + resource_group_name: str, service_name: str, application_accelerator_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationAcceleratorName": _SERIALIZER.url( + "application_accelerator_name", application_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationAcceleratorName": _SERIALIZER.url( + "application_accelerator_name", application_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + "customizedAcceleratorName": _SERIALIZER.url( + "customized_accelerator_name", customized_accelerator_name, "str", pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationAcceleratorName": _SERIALIZER.url( + "application_accelerator_name", application_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + "customizedAcceleratorName": _SERIALIZER.url( + "customized_accelerator_name", customized_accelerator_name, "str", pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationAcceleratorName": _SERIALIZER.url( + "application_accelerator_name", application_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + "customizedAcceleratorName": _SERIALIZER.url( + "customized_accelerator_name", customized_accelerator_name, "str", pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_validate_request( + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationAcceleratorName": _SERIALIZER.url( + "application_accelerator_name", application_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + "customizedAcceleratorName": _SERIALIZER.url( + "customized_accelerator_name", customized_accelerator_name, "str", pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class CustomizedAcceleratorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`customized_accelerators` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any + ) -> Iterable["_models.CustomizedAcceleratorResource"]: + """Handle requests to list all customized accelerators. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :return: An iterator like instance of either CustomizedAcceleratorResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.CustomizedAcceleratorResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + **kwargs: Any + ) -> _models.CustomizedAcceleratorResource: + """Get the customized accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :return: CustomizedAcceleratorResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + customized_accelerator_name=customized_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], + **kwargs: Any + ) -> _models.CustomizedAcceleratorResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(customized_accelerator_resource, (IOBase, bytes)): + _content = customized_accelerator_resource + else: + _json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + customized_accelerator_name=customized_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + customized_accelerator_resource: _models.CustomizedAcceleratorResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CustomizedAcceleratorResource]: + """Create or update the customized accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :param customized_accelerator_resource: The customized accelerator for the create or update + operation. Required. + :type customized_accelerator_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either CustomizedAcceleratorResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + customized_accelerator_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CustomizedAcceleratorResource]: + """Create or update the customized accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :param customized_accelerator_resource: The customized accelerator for the create or update + operation. Required. + :type customized_accelerator_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either CustomizedAcceleratorResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CustomizedAcceleratorResource]: + """Create or update the customized accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :param customized_accelerator_resource: The customized accelerator for the create or update + operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required. + :type customized_accelerator_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource or IO[bytes] + :return: An instance of LROPoller that returns either CustomizedAcceleratorResource or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + customized_accelerator_name=customized_accelerator_name, + customized_accelerator_resource=customized_accelerator_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CustomizedAcceleratorResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CustomizedAcceleratorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + customized_accelerator_name=customized_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Delete the customized accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + customized_accelerator_name=customized_accelerator_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _validate_initial( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.CustomizedAcceleratorValidateResult]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CustomizedAcceleratorValidateResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _json = self._serialize.body(properties, "CustomizedAcceleratorProperties") + + _request = build_validate_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + customized_accelerator_name=customized_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_validate( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + properties: _models.CustomizedAcceleratorProperties, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CustomizedAcceleratorValidateResult]: + """Check the customized accelerator are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :param properties: Customized accelerator properties to be validated. Required. + :type properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorProperties + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either CustomizedAcceleratorValidateResult or + the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_validate( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CustomizedAcceleratorValidateResult]: + """Check the customized accelerator are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :param properties: Customized accelerator properties to be validated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either CustomizedAcceleratorValidateResult or + the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_validate( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + customized_accelerator_name: str, + properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CustomizedAcceleratorValidateResult]: + """Check the customized accelerator are valid. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param customized_accelerator_name: The name of the customized accelerator. Required. + :type customized_accelerator_name: str + :param properties: Customized accelerator properties to be validated. Is either a + CustomizedAcceleratorProperties type or a IO[bytes] type. Required. + :type properties: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorProperties or IO[bytes] + :return: An instance of LROPoller that returns either CustomizedAcceleratorValidateResult or + the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomizedAcceleratorValidateResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomizedAcceleratorValidateResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._validate_initial( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + customized_accelerator_name=customized_accelerator_name, + properties=properties, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CustomizedAcceleratorValidateResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CustomizedAcceleratorValidateResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_deployments_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_deployments_operations.py new file mode 100644 index 00000000000..a8bf180ea4c --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_deployments_operations.py @@ -0,0 +1,2946 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, List, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, + service_name: str, + app_name: str, + subscription_id: str, + *, + version: Optional[List[str]] = None, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if version is not None: + _params["version"] = [_SERIALIZER.query("version", q, "str") if q is not None else "" for q in version] + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_for_cluster_request( + resource_group_name: str, + service_name: str, + subscription_id: str, + *, + version: Optional[List[str]] = None, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if version is not None: + _params["version"] = [_SERIALIZER.query("version", q, "str") if q is not None else "" for q in version] + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_start_request( + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_stop_request( + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_restart_request( + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_enable_remote_debugging_request( + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_disable_remote_debugging_request( + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_remote_debugging_config_request( # pylint: disable=name-too-long + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_log_file_url_request( + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_generate_heap_dump_request( + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_generate_thread_dump_request( + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_start_jfr_request( + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class DeploymentsOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`deployments` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> _models.DeploymentResource: + """Get a Deployment and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :return: DeploymentResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DeploymentResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], + **kwargs: Any + ) -> _models.DeploymentResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(deployment_resource, (IOBase, bytes)): + _content = deployment_resource + else: + _json = self._serialize.body(deployment_resource, "DeploymentResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DeploymentResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("DeploymentResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("DeploymentResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: _models.DeploymentResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DeploymentResource]: + """Create a new Deployment or update an exiting Deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param deployment_resource: Parameters for the create or update operation. Required. + :type deployment_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either DeploymentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DeploymentResource]: + """Create a new Deployment or update an exiting Deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param deployment_resource: Parameters for the create or update operation. Required. + :type deployment_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either DeploymentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DeploymentResource]: + """Create a new Deployment or update an exiting Deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param deployment_resource: Parameters for the create or update operation. Is either a + DeploymentResource type or a IO[bytes] type. Required. + :type deployment_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource or IO[bytes] + :return: An instance of LROPoller that returns either DeploymentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + deployment_resource=deployment_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DeploymentResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.DeploymentResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Operation to delete a Deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _update_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], + **kwargs: Any + ) -> _models.DeploymentResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(deployment_resource, (IOBase, bytes)): + _content = deployment_resource + else: + _json = self._serialize.body(deployment_resource, "DeploymentResource") + + _request = build_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DeploymentResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("DeploymentResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: _models.DeploymentResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DeploymentResource]: + """Operation to update an exiting Deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param deployment_resource: Parameters for the update operation. Required. + :type deployment_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either DeploymentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DeploymentResource]: + """Operation to update an exiting Deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param deployment_resource: Parameters for the update operation. Required. + :type deployment_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either DeploymentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + deployment_resource: Union[_models.DeploymentResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DeploymentResource]: + """Operation to update an exiting Deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param deployment_resource: Parameters for the update operation. Is either a DeploymentResource + type or a IO[bytes] type. Required. + :type deployment_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource or IO[bytes] + :return: An instance of LROPoller that returns either DeploymentResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + deployment_resource=deployment_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DeploymentResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.DeploymentResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DeploymentResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, + resource_group_name: str, + service_name: str, + app_name: str, + version: Optional[List[str]] = None, + expand: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.DeploymentResource"]: + """Handles requests to list all resources in an App. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param version: Version of the deployments to be listed. Default value is None. + :type version: list[str] + :param expand: The expand expression to apply on the operation. Default value is None. + :type expand: str + :return: An iterator like instance of either DeploymentResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.DeploymentResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + subscription_id=self._config.subscription_id, + version=version, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_for_cluster( + self, + resource_group_name: str, + service_name: str, + version: Optional[List[str]] = None, + expand: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.DeploymentResource"]: + """List deployments for a certain service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param version: Version of the deployments to be listed. Default value is None. + :type version: list[str] + :param expand: The expand expression to apply on the operation. Default value is None. + :type expand: str + :return: An iterator like instance of either DeploymentResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.DeploymentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.DeploymentResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_for_cluster_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + version=version, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_start_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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, {}) # type: ignore + + @distributed_trace + def begin_start( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Start the deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_stop_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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, {}) # type: ignore + + @distributed_trace + def begin_stop( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Stop the deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _restart_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_restart_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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, {}) # type: ignore + + @distributed_trace + def begin_restart( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Restart the deployment. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._restart_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _enable_remote_debugging_initial( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, + **kwargs: Any + ) -> _models.RemoteDebugging: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(remote_debugging_payload, (IOBase, bytes)): + _content = remote_debugging_payload + else: + if remote_debugging_payload is not None: + _json = self._serialize.body(remote_debugging_payload, "RemoteDebuggingPayload") + else: + _json = None + + _request = build_enable_remote_debugging_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RemoteDebugging", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("RemoteDebugging", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_enable_remote_debugging( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + remote_debugging_payload: Optional[_models.RemoteDebuggingPayload] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RemoteDebugging]: + """Enable remote debugging. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. + :type remote_debugging_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.RemoteDebuggingPayload + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either RemoteDebugging or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.RemoteDebugging] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_enable_remote_debugging( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + remote_debugging_payload: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RemoteDebugging]: + """Enable remote debugging. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param remote_debugging_payload: Parameters for enable remote debugging. Default value is None. + :type remote_debugging_payload: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either RemoteDebugging or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.RemoteDebugging] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_enable_remote_debugging( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[_models.RemoteDebugging]: + """Enable remote debugging. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param remote_debugging_payload: Parameters for enable remote debugging. Is either a + RemoteDebuggingPayload type or a IO[bytes] type. Default value is None. + :type remote_debugging_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.RemoteDebuggingPayload or IO[bytes] + :return: An instance of LROPoller that returns either RemoteDebugging or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.RemoteDebugging] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._enable_remote_debugging_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + remote_debugging_payload=remote_debugging_payload, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RemoteDebugging", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RemoteDebugging].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _disable_remote_debugging_initial( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> _models.RemoteDebugging: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) + + _request = build_disable_remote_debugging_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("RemoteDebugging", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("RemoteDebugging", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_disable_remote_debugging( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> LROPoller[_models.RemoteDebugging]: + """Disable remote debugging. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :return: An instance of LROPoller that returns either RemoteDebugging or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.RemoteDebugging] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._disable_remote_debugging_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RemoteDebugging", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RemoteDebugging].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RemoteDebugging]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get_remote_debugging_config( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> _models.RemoteDebugging: + """Get remote debugging config. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :return: RemoteDebugging or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.RemoteDebugging + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None) + + _request = build_get_remote_debugging_config_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RemoteDebugging", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_log_file_url( + self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any + ) -> Optional[_models.LogFileUrlResponse]: + """Get deployment log file URL. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :return: LogFileUrlResponse or None or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.LogFileUrlResponse or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None) + + _request = build_get_log_file_url_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("LogFileUrlResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(diagnostic_parameters, (IOBase, bytes)): + _content = diagnostic_parameters + else: + _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") + + _request = build_generate_heap_dump_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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, {}) # type: ignore + + @overload + def begin_generate_heap_dump( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: _models.DiagnosticParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Generate Heap Dump. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Required. + :type diagnostic_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DiagnosticParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + def begin_generate_heap_dump( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Generate Heap Dump. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Required. + :type diagnostic_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace + def begin_generate_heap_dump( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Generate Heap Dump. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a + DiagnosticParameters type or a IO[bytes] type. Required. + :type diagnostic_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DiagnosticParameters or IO[bytes] + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._generate_heap_dump_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + diagnostic_parameters=diagnostic_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(diagnostic_parameters, (IOBase, bytes)): + _content = diagnostic_parameters + else: + _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") + + _request = build_generate_thread_dump_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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, {}) # type: ignore + + @overload + def begin_generate_thread_dump( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: _models.DiagnosticParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Generate Thread Dump. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Required. + :type diagnostic_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DiagnosticParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + def begin_generate_thread_dump( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Generate Thread Dump. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Required. + :type diagnostic_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace + def begin_generate_thread_dump( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Generate Thread Dump. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a + DiagnosticParameters type or a IO[bytes] type. Required. + :type diagnostic_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DiagnosticParameters or IO[bytes] + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._generate_thread_dump_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + diagnostic_parameters=diagnostic_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _start_jfr_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(diagnostic_parameters, (IOBase, bytes)): + _content = diagnostic_parameters + else: + _json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters") + + _request = build_start_jfr_request( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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, {}) # type: ignore + + @overload + def begin_start_jfr( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: _models.DiagnosticParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Start JFR. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Required. + :type diagnostic_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DiagnosticParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + def begin_start_jfr( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Start JFR. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Required. + :type diagnostic_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace + def begin_start_jfr( + self, + resource_group_name: str, + service_name: str, + app_name: str, + deployment_name: str, + diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Start JFR. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param app_name: The name of the App resource. Required. + :type app_name: str + :param deployment_name: The name of the Deployment resource. Required. + :type deployment_name: str + :param diagnostic_parameters: Parameters for the diagnostic operation. Is either a + DiagnosticParameters type or a IO[bytes] type. Required. + :type diagnostic_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DiagnosticParameters or IO[bytes] + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_jfr_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + diagnostic_parameters=diagnostic_parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_dev_tool_portals_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_dev_tool_portals_operations.py new file mode 100644 index 00000000000..ea049b91a6a --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_dev_tool_portals_operations.py @@ -0,0 +1,666 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/devToolPortals", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, service_name: str, dev_tool_portal_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "devToolPortalName": _SERIALIZER.url( + "dev_tool_portal_name", dev_tool_portal_name, "str", pattern=r"^[a-z][a-z0-9]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, dev_tool_portal_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "devToolPortalName": _SERIALIZER.url( + "dev_tool_portal_name", dev_tool_portal_name, "str", pattern=r"^[a-z][a-z0-9]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, dev_tool_portal_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "devToolPortalName": _SERIALIZER.url( + "dev_tool_portal_name", dev_tool_portal_name, "str", pattern=r"^[a-z][a-z0-9]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class DevToolPortalsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`dev_tool_portals` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> Iterable["_models.DevToolPortalResource"]: + """Handles requests to list all resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either DevToolPortalResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.DevToolPortalResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any + ) -> _models.DevToolPortalResource: + """Get the Application Live and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param dev_tool_portal_name: The name of Dev Tool Portal. Required. + :type dev_tool_portal_name: str + :return: DevToolPortalResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + dev_tool_portal_name=dev_tool_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("DevToolPortalResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + dev_tool_portal_name: str, + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], + **kwargs: Any + ) -> _models.DevToolPortalResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(dev_tool_portal_resource, (IOBase, bytes)): + _content = dev_tool_portal_resource + else: + _json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + dev_tool_portal_name=dev_tool_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("DevToolPortalResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("DevToolPortalResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + dev_tool_portal_name: str, + dev_tool_portal_resource: _models.DevToolPortalResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DevToolPortalResource]: + """Create the default Dev Tool Portal or update the existing Dev Tool Portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param dev_tool_portal_name: The name of Dev Tool Portal. Required. + :type dev_tool_portal_name: str + :param dev_tool_portal_resource: Parameters for the create or update operation. Required. + :type dev_tool_portal_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either DevToolPortalResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + dev_tool_portal_name: str, + dev_tool_portal_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DevToolPortalResource]: + """Create the default Dev Tool Portal or update the existing Dev Tool Portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param dev_tool_portal_name: The name of Dev Tool Portal. Required. + :type dev_tool_portal_name: str + :param dev_tool_portal_resource: Parameters for the create or update operation. Required. + :type dev_tool_portal_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either DevToolPortalResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + dev_tool_portal_name: str, + dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DevToolPortalResource]: + """Create the default Dev Tool Portal or update the existing Dev Tool Portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param dev_tool_portal_name: The name of Dev Tool Portal. Required. + :type dev_tool_portal_name: str + :param dev_tool_portal_resource: Parameters for the create or update operation. Is either a + DevToolPortalResource type or a IO[bytes] type. Required. + :type dev_tool_portal_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource or IO[bytes] + :return: An instance of LROPoller that returns either DevToolPortalResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.DevToolPortalResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + dev_tool_portal_name=dev_tool_portal_name, + dev_tool_portal_resource=dev_tool_portal_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("DevToolPortalResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.DevToolPortalResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DevToolPortalResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + dev_tool_portal_name=dev_tool_portal_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Disable the default Dev Tool Portal. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param dev_tool_portal_name: The name of Dev Tool Portal. Required. + :type dev_tool_portal_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + dev_tool_portal_name=dev_tool_portal_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_eureka_servers_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_eureka_servers_operations.py new file mode 100644 index 00000000000..9e8d6aaa8f3 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_eureka_servers_operations.py @@ -0,0 +1,712 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_put_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_patch_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +class EurekaServersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`eureka_servers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> _models.EurekaServerResourceCollection: + """List the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: EurekaServerResourceCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResourceCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.EurekaServerResourceCollection] = kwargs.pop("cls", None) + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EurekaServerResourceCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.EurekaServerResource: + """Get the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: EurekaServerResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EurekaServerResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _update_put_initial( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], + **kwargs: Any + ) -> _models.EurekaServerResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(eureka_server_resource, (IOBase, bytes)): + _content = eureka_server_resource + else: + _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") + + _request = build_update_put_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("EurekaServerResource", pipeline_response) + + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("EurekaServerResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: _models.EurekaServerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either EurekaServerResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either EurekaServerResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Is either a + EurekaServerResource type or a IO[bytes] type. Required. + :type eureka_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource or IO[bytes] + :return: An instance of LROPoller that returns either EurekaServerResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_put_initial( + resource_group_name=resource_group_name, + service_name=service_name, + eureka_server_resource=eureka_server_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EurekaServerResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.EurekaServerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_patch_initial( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], + **kwargs: Any + ) -> _models.EurekaServerResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(eureka_server_resource, (IOBase, bytes)): + _content = eureka_server_resource + else: + _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") + + _request = build_update_patch_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("EurekaServerResource", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = self._deserialize("EurekaServerResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: _models.EurekaServerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either EurekaServerResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either EurekaServerResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Is either a + EurekaServerResource type or a IO[bytes] type. Required. + :type eureka_server_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource or IO[bytes] + :return: An instance of LROPoller that returns either EurekaServerResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EurekaServerResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_patch_initial( + resource_group_name=resource_group_name, + service_name=service_name, + eureka_server_resource=eureka_server_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("EurekaServerResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.EurekaServerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_gateway_custom_domains_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_gateway_custom_domains_operations.py new file mode 100644 index 00000000000..db34502ae8f --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_gateway_custom_domains_operations.py @@ -0,0 +1,701 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + service_name: str, + gateway_name: str, + domain_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + "domainName": _SERIALIZER.url("domain_name", domain_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, + service_name: str, + gateway_name: str, + domain_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + "domainName": _SERIALIZER.url("domain_name", domain_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + service_name: str, + gateway_name: str, + domain_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + "domainName": _SERIALIZER.url("domain_name", domain_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, service_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class GatewayCustomDomainsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`gateway_custom_domains` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any + ) -> _models.GatewayCustomDomainResource: + """Get the Spring Cloud Gateway custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. + :type domain_name: str + :return: GatewayCustomDomainResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + domain_name: str, + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> _models.GatewayCustomDomainResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(gateway_custom_domain_resource, (IOBase, bytes)): + _content = gateway_custom_domain_resource + else: + _json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + domain_name: str, + gateway_custom_domain_resource: _models.GatewayCustomDomainResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GatewayCustomDomainResource]: + """Create or update the Spring Cloud Gateway custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. + :type domain_name: str + :param gateway_custom_domain_resource: The gateway custom domain resource for the create or + update operation. Required. + :type gateway_custom_domain_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + domain_name: str, + gateway_custom_domain_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GatewayCustomDomainResource]: + """Create or update the Spring Cloud Gateway custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. + :type domain_name: str + :param gateway_custom_domain_resource: The gateway custom domain resource for the create or + update operation. Required. + :type gateway_custom_domain_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + domain_name: str, + gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.GatewayCustomDomainResource]: + """Create or update the Spring Cloud Gateway custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. + :type domain_name: str + :param gateway_custom_domain_resource: The gateway custom domain resource for the create or + update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required. + :type gateway_custom_domain_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource or IO[bytes] + :return: An instance of LROPoller that returns either GatewayCustomDomainResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + domain_name=domain_name, + gateway_custom_domain_resource=gateway_custom_domain_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.GatewayCustomDomainResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.GatewayCustomDomainResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + domain_name=domain_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete the Spring Cloud Gateway custom domain. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param domain_name: The name of the Spring Cloud Gateway custom domain. Required. + :type domain_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + domain_name=domain_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> Iterable["_models.GatewayCustomDomainResource"]: + """Handle requests to list all Spring Cloud Gateway custom domains. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :return: An iterator like instance of either GatewayCustomDomainResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayCustomDomainResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.GatewayCustomDomainResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_gateway_route_configs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_gateway_route_configs_operations.py new file mode 100644 index 00000000000..afc2306c737 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_gateway_route_configs_operations.py @@ -0,0 +1,704 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + service_name: str, + gateway_name: str, + route_config_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + "routeConfigName": _SERIALIZER.url("route_config_name", route_config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, + service_name: str, + gateway_name: str, + route_config_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + "routeConfigName": _SERIALIZER.url("route_config_name", route_config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + service_name: str, + gateway_name: str, + route_config_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + "routeConfigName": _SERIALIZER.url("route_config_name", route_config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, service_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class GatewayRouteConfigsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`gateway_route_configs` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any + ) -> _models.GatewayRouteConfigResource: + """Get the Spring Cloud Gateway route configs. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param route_config_name: The name of the Spring Cloud Gateway route config. Required. + :type route_config_name: str + :return: GatewayRouteConfigResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + route_config_name=route_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + route_config_name: str, + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], + **kwargs: Any + ) -> _models.GatewayRouteConfigResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(gateway_route_config_resource, (IOBase, bytes)): + _content = gateway_route_config_resource + else: + _json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + route_config_name=route_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + route_config_name: str, + gateway_route_config_resource: _models.GatewayRouteConfigResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GatewayRouteConfigResource]: + """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud + Gateway route configs. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param route_config_name: The name of the Spring Cloud Gateway route config. Required. + :type route_config_name: str + :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or + update operation. Required. + :type gateway_route_config_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + route_config_name: str, + gateway_route_config_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GatewayRouteConfigResource]: + """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud + Gateway route configs. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param route_config_name: The name of the Spring Cloud Gateway route config. Required. + :type route_config_name: str + :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or + update operation. Required. + :type gateway_route_config_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + route_config_name: str, + gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.GatewayRouteConfigResource]: + """Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud + Gateway route configs. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param route_config_name: The name of the Spring Cloud Gateway route config. Required. + :type route_config_name: str + :param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or + update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required. + :type gateway_route_config_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource or IO[bytes] + :return: An instance of LROPoller that returns either GatewayRouteConfigResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + route_config_name=route_config_name, + gateway_route_config_resource=gateway_route_config_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.GatewayRouteConfigResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.GatewayRouteConfigResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + route_config_name=route_config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete the Spring Cloud Gateway route config. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param route_config_name: The name of the Spring Cloud Gateway route config. Required. + :type route_config_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + route_config_name=route_config_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> Iterable["_models.GatewayRouteConfigResource"]: + """Handle requests to list all Spring Cloud Gateway route configs. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :return: An iterator like instance of either GatewayRouteConfigResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayRouteConfigResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.GatewayRouteConfigResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_gateways_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_gateways_operations.py new file mode 100644 index 00000000000..208da660bc3 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_gateways_operations.py @@ -0,0 +1,1319 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, service_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_capacity_request( + resource_group_name: str, service_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_env_secrets_request( + resource_group_name: str, service_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_restart_request( + resource_group_name: str, service_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_validate_domain_request( + resource_group_name: str, service_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"^[a-z][a-z0-9]*$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class GatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> _models.GatewayResource: + """Get the Spring Cloud Gateway and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :return: GatewayResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GatewayResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_resource: Union[_models.GatewayResource, IO[bytes]], + **kwargs: Any + ) -> _models.GatewayResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(gateway_resource, (IOBase, bytes)): + _content = gateway_resource + else: + _json = self._serialize.body(gateway_resource, "GatewayResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("GatewayResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("GatewayResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_resource: _models.GatewayResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GatewayResource]: + """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_resource: The gateway for the create or update operation. Required. + :type gateway_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GatewayResource]: + """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_resource: The gateway for the create or update operation. Required. + :type gateway_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_resource: Union[_models.GatewayResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.GatewayResource]: + """Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_resource: The gateway for the create or update operation. Is either a + GatewayResource type or a IO[bytes] type. Required. + :type gateway_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource or + IO[bytes] + :return: An instance of LROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + gateway_resource=gateway_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("GatewayResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.GatewayResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_capacity_initial( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.GatewayResource]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GatewayResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(gateway_capacity_resource, (IOBase, bytes)): + _content = gateway_capacity_resource + else: + _json = self._serialize.body(gateway_capacity_resource, "SkuObject") + + _request = build_update_capacity_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("GatewayResource", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_capacity( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: _models.SkuObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GatewayResource]: + """Operation to update an exiting Spring Cloud Gateway capacity. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_capacity_resource: The gateway capacity for the update operation. Required. + :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SkuObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_capacity( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GatewayResource]: + """Operation to update an exiting Spring Cloud Gateway capacity. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_capacity_resource: The gateway capacity for the update operation. Required. + :type gateway_capacity_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_capacity( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.GatewayResource]: + """Operation to update an exiting Spring Cloud Gateway capacity. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a + SkuObject type or a IO[bytes] type. Required. + :type gateway_capacity_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.SkuObject + or IO[bytes] + :return: An instance of LROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_capacity_initial( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + gateway_capacity_resource=gateway_capacity_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("GatewayResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.GatewayResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Disable the default Spring Cloud Gateway. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_env_secrets( + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> Dict[str, str]: + """List sensitive environment variables of Spring Cloud Gateway. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :return: dict mapping str to str or the result of cls(response) + :rtype: dict[str, str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None) + + _request = build_list_env_secrets_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("{str}", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _restart_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_restart_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_restart( + self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Restart the Spring Cloud Gateway. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._restart_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.GatewayResource"]: + """Handles requests to list all resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either GatewayResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.GatewayResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("GatewayResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @overload + def validate_domain( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + validate_payload: _models.CustomDomainValidatePayload, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the domains are valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param validate_payload: Custom domain payload to be validated. Required. + :type validate_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidatePayload + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate_domain( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + validate_payload: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the domains are valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param validate_payload: Custom domain payload to be validated. Required. + :type validate_payload: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def validate_domain( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]], + **kwargs: Any + ) -> _models.CustomDomainValidateResult: + """Check the domains are valid as well as not in use. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param validate_payload: Custom domain payload to be validated. Is either a + CustomDomainValidatePayload type or a IO[bytes] type. Required. + :type validate_payload: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidatePayload or IO[bytes] + :return: CustomDomainValidateResult or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.CustomDomainValidateResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomDomainValidateResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(validate_payload, (IOBase, bytes)): + _content = validate_payload + else: + _json = self._serialize.body(validate_payload, "CustomDomainValidatePayload") + + _request = build_validate_domain_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_job_execution_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_job_execution_operations.py new file mode 100644 index 00000000000..12ef0bfb20c --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_job_execution_operations.py @@ -0,0 +1,422 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_cancel_request( + resource_group_name: str, + service_name: str, + job_name: str, + job_execution_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}/executions/{jobExecutionName}/cancel", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobExecutionName": _SERIALIZER.url( + "job_execution_name", job_execution_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, + service_name: str, + job_name: str, + job_execution_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}/executions/{jobExecutionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobExecutionName": _SERIALIZER.url( + "job_execution_name", job_execution_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_env_secrets_request( + resource_group_name: str, + service_name: str, + job_name: str, + job_execution_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}/executions/{jobExecutionName}/listEnvSecrets", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobExecutionName": _SERIALIZER.url( + "job_execution_name", job_execution_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class JobExecutionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`job_execution` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _cancel_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_cancel_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_cancel( + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Terminate execution of a running Azure Spring Apps Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_execution_name: The name of the Job execution. Required. + :type job_execution_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._cancel_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> _models.JobExecution: + """Get details of an execution of an Azure Spring Apps Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_execution_name: The name of the Job execution. Required. + :type job_execution_name: str + :return: JobExecution or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecution + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("JobExecution", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_env_secrets( + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> _models.EnvSecretsCollection: + """List sensitive environment variables of Job execution. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_execution_name: The name of the Job execution. Required. + :type job_execution_name: str + :return: EnvSecretsCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.EnvSecretsCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.EnvSecretsCollection] = kwargs.pop("cls", None) + + _request = build_list_env_secrets_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EnvSecretsCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_job_executions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_job_executions_operations.py new file mode 100644 index 00000000000..e1828e67f42 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_job_executions_operations.py @@ -0,0 +1,180 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request( + resource_group_name: str, service_name: str, job_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}/executions", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class JobExecutionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`job_executions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> Iterable["_models.JobExecution"]: + """Get executions of a Azure Spring Apps Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :return: An iterator like instance of either JobExecution or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.JobExecutionCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("JobExecutionCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_job_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_job_operations.py new file mode 100644 index 00000000000..e54b0e128d3 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_job_operations.py @@ -0,0 +1,890 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, service_name: str, job_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, job_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, job_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_start_request( + resource_group_name: str, service_name: str, job_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}/start", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_env_secrets_request( + resource_group_name: str, service_name: str, job_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}/listEnvSecrets", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class JobOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`job` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any) -> _models.JobResource: + """Get a Job and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :return: JobResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("JobResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + job_name: str, + job_resource: Union[_models.JobResource, IO[bytes]], + **kwargs: Any + ) -> _models.JobResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(job_resource, (IOBase, bytes)): + _content = job_resource + else: + _json = self._serialize.body(job_resource, "JobResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("JobResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("JobResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Create a new Job or update an exiting Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_resource: Parameters for the create or update operation. Required. + :type job_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + job_name: str, + job_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Create a new Job or update an exiting Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_resource: Parameters for the create or update operation. Required. + :type job_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + job_name: str, + job_resource: Union[_models.JobResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Create a new Job or update an exiting Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_resource: Parameters for the create or update operation. Is either a JobResource + type or a IO[bytes] type. Required. + :type job_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource or IO[bytes] + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_resource=job_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("JobResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.JobResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.JobResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Operation to delete a Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _start_initial( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[Union[_models.JobExecutionTemplate, IO[bytes]]] = None, + **kwargs: Any + ) -> Optional[_models.JobExecution]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.JobExecution]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(template, (IOBase, bytes)): + _content = template + else: + if template is not None: + _json = self._serialize.body(template, "JobExecutionTemplate") + else: + _json = None + + _request = build_start_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("JobExecution", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_start( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[_models.JobExecutionTemplate] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobExecution]: + """Start an Azure Spring Apps Job. + + Start an Azure Spring Apps Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param template: Template used to start a Job execution. Default value is None. + :type template: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecutionTemplate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either JobExecution or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_start( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobExecution]: + """Start an Azure Spring Apps Job. + + Start an Azure Spring Apps Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param template: Template used to start a Job execution. Default value is None. + :type template: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either JobExecution or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_start( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[Union[_models.JobExecutionTemplate, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[_models.JobExecution]: + """Start an Azure Spring Apps Job. + + Start an Azure Spring Apps Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param template: Template used to start a Job execution. Is either a JobExecutionTemplate type + or a IO[bytes] type. Default value is None. + :type template: ~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecutionTemplate or + IO[bytes] + :return: An instance of LROPoller that returns either JobExecution or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_initial( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + template=template, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("JobExecution", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.JobExecution].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.JobExecution]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_env_secrets( + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> _models.EnvSecretsCollection: + """List sensitive environment variables of the Job. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :return: EnvSecretsCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.EnvSecretsCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.EnvSecretsCollection] = kwargs.pop("cls", None) + + _request = build_list_env_secrets_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EnvSecretsCollection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_jobs_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_jobs_operations.py new file mode 100644 index 00000000000..781b4cfdac9 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_jobs_operations.py @@ -0,0 +1,172 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class JobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`jobs` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.JobResource"]: + """Get the Azure Spring Apps Jobs in a given service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either JobResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.JobResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("JobResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_monitoring_settings_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_monitoring_settings_operations.py new file mode 100644 index 00000000000..81cc9e43af5 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_monitoring_settings_operations.py @@ -0,0 +1,613 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_put_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_patch_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +class MonitoringSettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`monitoring_settings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.MonitoringSettingResource: + """Get the Monitoring Setting and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: MonitoringSettingResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _update_put_initial( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], + **kwargs: Any + ) -> _models.MonitoringSettingResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(monitoring_setting_resource, (IOBase, bytes)): + _content = monitoring_setting_resource + else: + _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") + + _request = build_update_put_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: _models.MonitoringSettingResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MonitoringSettingResource]: + """Update the Monitoring Setting. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param monitoring_setting_resource: Parameters for the update operation. Required. + :type monitoring_setting_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either MonitoringSettingResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MonitoringSettingResource]: + """Update the Monitoring Setting. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param monitoring_setting_resource: Parameters for the update operation. Required. + :type monitoring_setting_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either MonitoringSettingResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.MonitoringSettingResource]: + """Update the Monitoring Setting. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param monitoring_setting_resource: Parameters for the update operation. Is either a + MonitoringSettingResource type or a IO[bytes] type. Required. + :type monitoring_setting_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource or IO[bytes] + :return: An instance of LROPoller that returns either MonitoringSettingResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_put_initial( + resource_group_name=resource_group_name, + service_name=service_name, + monitoring_setting_resource=monitoring_setting_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_patch_initial( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], + **kwargs: Any + ) -> _models.MonitoringSettingResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(monitoring_setting_resource, (IOBase, bytes)): + _content = monitoring_setting_resource + else: + _json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource") + + _request = build_update_patch_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: _models.MonitoringSettingResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MonitoringSettingResource]: + """Update the Monitoring Setting. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param monitoring_setting_resource: Parameters for the update operation. Required. + :type monitoring_setting_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either MonitoringSettingResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MonitoringSettingResource]: + """Update the Monitoring Setting. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param monitoring_setting_resource: Parameters for the update operation. Required. + :type monitoring_setting_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either MonitoringSettingResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.MonitoringSettingResource]: + """Update the Monitoring Setting. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param monitoring_setting_resource: Parameters for the update operation. Is either a + MonitoringSettingResource type or a IO[bytes] type. Required. + :type monitoring_setting_resource: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource or IO[bytes] + :return: An instance of LROPoller that returns either MonitoringSettingResource or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.MonitoringSettingResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_patch_initial( + resource_group_name=resource_group_name, + service_name=service_name, + monitoring_setting_resource=monitoring_setting_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("MonitoringSettingResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.MonitoringSettingResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.MonitoringSettingResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_operations.py new file mode 100644 index 00000000000..83cbde44fec --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_operations.py @@ -0,0 +1,154 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.AppPlatform/operations") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: + """Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + + :return: An iterator like instance of either OperationDetail or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.OperationDetail] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.AvailableOperations] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AvailableOperations", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_patch.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_predefined_accelerators_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_predefined_accelerators_operations.py new file mode 100644 index 00000000000..e4a7a653620 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_predefined_accelerators_operations.py @@ -0,0 +1,626 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request( + resource_group_name: str, service_name: str, application_accelerator_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationAcceleratorName": _SERIALIZER.url( + "application_accelerator_name", application_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + predefined_accelerator_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationAcceleratorName": _SERIALIZER.url( + "application_accelerator_name", application_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + "predefinedAcceleratorName": _SERIALIZER.url( + "predefined_accelerator_name", predefined_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_disable_request( + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + predefined_accelerator_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationAcceleratorName": _SERIALIZER.url( + "application_accelerator_name", application_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + "predefinedAcceleratorName": _SERIALIZER.url( + "predefined_accelerator_name", predefined_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_enable_request( + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + predefined_accelerator_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "applicationAcceleratorName": _SERIALIZER.url( + "application_accelerator_name", application_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + "predefinedAcceleratorName": _SERIALIZER.url( + "predefined_accelerator_name", predefined_accelerator_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class PredefinedAcceleratorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`predefined_accelerators` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any + ) -> Iterable["_models.PredefinedAcceleratorResource"]: + """Handle requests to list all predefined accelerators. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :return: An iterator like instance of either PredefinedAcceleratorResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.PredefinedAcceleratorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.PredefinedAcceleratorResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + predefined_accelerator_name: str, + **kwargs: Any + ) -> _models.PredefinedAcceleratorResource: + """Get the predefined accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param predefined_accelerator_name: The name of the predefined accelerator. Required. + :type predefined_accelerator_name: str + :return: PredefinedAcceleratorResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.PredefinedAcceleratorResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + predefined_accelerator_name=predefined_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _disable_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + predefined_accelerator_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_disable_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + predefined_accelerator_name=predefined_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_disable( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + predefined_accelerator_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Disable predefined accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param predefined_accelerator_name: The name of the predefined accelerator. Required. + :type predefined_accelerator_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._disable_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + predefined_accelerator_name=predefined_accelerator_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _enable_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + predefined_accelerator_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_enable_request( + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + predefined_accelerator_name=predefined_accelerator_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_enable( + self, + resource_group_name: str, + service_name: str, + application_accelerator_name: str, + predefined_accelerator_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Enable predefined accelerator. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param application_accelerator_name: The name of the application accelerator. Required. + :type application_accelerator_name: str + :param predefined_accelerator_name: The name of the predefined accelerator. Required. + :type predefined_accelerator_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._enable_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + application_accelerator_name=application_accelerator_name, + predefined_accelerator_name=predefined_accelerator_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_runtime_versions_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_runtime_versions_operations.py new file mode 100644 index 00000000000..248b370c754 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_runtime_versions_operations.py @@ -0,0 +1,124 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_runtime_versions_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.AppPlatform/runtimeVersions") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class RuntimeVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`runtime_versions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: + """Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + + :return: AvailableRuntimeVersions or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.AvailableRuntimeVersions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None) + + _request = build_list_runtime_versions_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_service_registries_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_service_registries_operations.py new file mode 100644 index 00000000000..1cbeaf7156c --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_service_registries_operations.py @@ -0,0 +1,558 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, service_name: str, service_registry_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "serviceRegistryName": _SERIALIZER.url("service_registry_name", service_registry_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, service_registry_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "serviceRegistryName": _SERIALIZER.url("service_registry_name", service_registry_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, service_registry_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "serviceRegistryName": _SERIALIZER.url("service_registry_name", service_registry_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ServiceRegistriesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`service_registries` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any + ) -> _models.ServiceRegistryResource: + """Get the Service Registry and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param service_registry_name: The name of Service Registry. Required. + :type service_registry_name: str + :return: ServiceRegistryResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceRegistryResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + service_registry_name=service_registry_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any + ) -> _models.ServiceRegistryResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + service_registry_name=service_registry_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_create_or_update( + self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any + ) -> LROPoller[_models.ServiceRegistryResource]: + """Create the default Service Registry or update the existing 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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param service_registry_name: The name of Service Registry. Required. + :type service_registry_name: str + :return: An instance of LROPoller that returns either ServiceRegistryResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceRegistryResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + service_registry_name=service_registry_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ServiceRegistryResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServiceRegistryResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServiceRegistryResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + service_registry_name=service_registry_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any + ) -> 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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param service_registry_name: The name of Service Registry. Required. + :type service_registry_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + service_registry_name=service_registry_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> Iterable["_models.ServiceRegistryResource"]: + """Handles requests to list all resources in a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ServiceRegistryResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceRegistryResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ServiceRegistryResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_services_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_services_operations.py new file mode 100644 index 00000000000..bee41ea4e23 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_services_operations.py @@ -0,0 +1,2690 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_test_keys_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_regenerate_test_key_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_disable_test_endpoint_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_enable_test_endpoint_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_stop_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_start_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flush_vnet_dns_setting_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_supported_apm_types_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_globally_enabled_apms_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_enable_apm_globally_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_disable_apm_globally_request( + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_check_name_availability_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_supported_server_versions_request( # pylint: disable=name-too-long + resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedServerVersions", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ServicesOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`services` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.ServiceResource: + """Get a Service and its properties. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: ServiceResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ServiceResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any + ) -> _models.ServiceResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _json = self._serialize.body(resource, "ServiceResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ServiceResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ServiceResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ServiceResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + resource: _models.ServiceResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServiceResource]: + """Create a new Service or update an exiting Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param resource: Parameters for the create or update operation. Required. + :type resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ServiceResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServiceResource]: + """Create a new Service or update an exiting Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param resource: Parameters for the create or update operation. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ServiceResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServiceResource]: + """Create a new Service or update an exiting Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param resource: Parameters for the create or update operation. Is either a ServiceResource + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource or IO[bytes] + :return: An instance of LROPoller that returns either ServiceResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + resource=resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ServiceResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServiceResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: + """Operation to delete a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _update_initial( + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any + ) -> _models.ServiceResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _json = self._serialize.body(resource, "ServiceResource") + + _request = build_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ServiceResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("ServiceResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + service_name: str, + resource: _models.ServiceResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServiceResource]: + """Operation to update an exiting Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param resource: Parameters for the update operation. Required. + :type resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ServiceResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + service_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServiceResource]: + """Operation to update an exiting Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param resource: Parameters for the update operation. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ServiceResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + service_name: str, + resource: Union[_models.ServiceResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServiceResource]: + """Operation to update an exiting Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param resource: Parameters for the update operation. Is either a ServiceResource type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource or IO[bytes] + :return: An instance of LROPoller that returns either ServiceResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + resource=resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ServiceResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServiceResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServiceResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: + """List test keys for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: TestKeys or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.TestKeys + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) + + _request = build_list_test_keys_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TestKeys", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def regenerate_test_key( + self, + resource_group_name: str, + service_name: str, + regenerate_test_key_request: _models.RegenerateTestKeyRequestPayload, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TestKeys: + """Regenerate a test key for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param regenerate_test_key_request: Parameters for the operation. Required. + :type regenerate_test_key_request: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.RegenerateTestKeyRequestPayload + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TestKeys or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.TestKeys + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def regenerate_test_key( + self, + resource_group_name: str, + service_name: str, + regenerate_test_key_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TestKeys: + """Regenerate a test key for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param regenerate_test_key_request: Parameters for the operation. Required. + :type regenerate_test_key_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TestKeys or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.TestKeys + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def regenerate_test_key( + self, + resource_group_name: str, + service_name: str, + regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]], + **kwargs: Any + ) -> _models.TestKeys: + """Regenerate a test key for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param regenerate_test_key_request: Parameters for the operation. Is either a + RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required. + :type regenerate_test_key_request: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.RegenerateTestKeyRequestPayload or IO[bytes] + :return: TestKeys or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.TestKeys + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(regenerate_test_key_request, (IOBase, bytes)): + _content = regenerate_test_key_request + else: + _json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload") + + _request = build_regenerate_test_key_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TestKeys", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def disable_test_endpoint( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + """Disable test endpoint functionality for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_disable_test_endpoint_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys: + """Enable test endpoint functionality for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: TestKeys or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.TestKeys + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None) + + _request = build_enable_test_endpoint_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TestKeys", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 304: ResourceNotModifiedError, + 404: lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), + 409: lambda response: ResourceExistsError(response=response, error_format=ARMErrorFormat), + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_stop_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: + """Stop a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 304: ResourceNotModifiedError, + 404: lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), + 409: lambda response: ResourceExistsError(response=response, error_format=ARMErrorFormat), + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_start_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: + """Start a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_flush_vnet_dns_setting_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_flush_vnet_dns_setting( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Flush Virtual Network DNS settings for a VNET injected Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._flush_vnet_dns_setting_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_supported_apm_types( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> Iterable["_models.SupportedApmType"]: + """List supported APM types for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either SupportedApmType or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedApmType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.SupportedApmTypes] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_supported_apm_types_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SupportedApmTypes", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_globally_enabled_apms( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> _models.GloballyEnabledApms: + """List globally enabled APMs for a Service. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: GloballyEnabledApms or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.GloballyEnabledApms + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None) + + _request = build_list_globally_enabled_apms_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GloballyEnabledApms", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(apm, (IOBase, bytes)): + _content = apm + else: + _json = self._serialize.body(apm, "ApmReference") + + _request = build_enable_apm_globally_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_enable_apm_globally( + self, + resource_group_name: str, + service_name: str, + apm: _models.ApmReference, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Enable an APM globally. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm: The target APM for the enable operation. Required. + :type apm: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmReference + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + def begin_enable_apm_globally( + self, + resource_group_name: str, + service_name: str, + apm: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Enable an APM globally. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm: The target APM for the enable operation. Required. + :type apm: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace + def begin_enable_apm_globally( + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any + ) -> LROPoller[None]: + """Enable an APM globally. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm: The target APM for the enable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmReference or IO[bytes] + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._enable_apm_globally_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + apm=apm, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(apm, (IOBase, bytes)): + _content = apm + else: + _json = self._serialize.body(apm, "ApmReference") + + _request = build_disable_apm_globally_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_disable_apm_globally( + self, + resource_group_name: str, + service_name: str, + apm: _models.ApmReference, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Disable an APM globally. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm: The target APM for the disable operation. Required. + :type apm: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmReference + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @overload + def begin_disable_apm_globally( + self, + resource_group_name: str, + service_name: str, + apm: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Disable an APM globally. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm: The target APM for the disable operation. Required. + :type apm: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :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: + """ + + @distributed_trace + def begin_disable_apm_globally( + self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any + ) -> LROPoller[None]: + """Disable an APM globally. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param apm: The target APM for the disable operation. Is either a ApmReference type or a + IO[bytes] type. Required. + :type apm: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmReference or IO[bytes] + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._disable_apm_globally_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + apm=apm, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def check_name_availability( + self, + location: str, + availability_parameters: _models.NameAvailabilityParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NameAvailability: + """Checks that the resource name is valid and is not already in use. + + :param location: the region. Required. + :type location: str + :param availability_parameters: Parameters supplied to the operation. Required. + :type availability_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.NameAvailabilityParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NameAvailability or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.NameAvailability + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def check_name_availability( + self, + location: str, + availability_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NameAvailability: + """Checks that the resource name is valid and is not already in use. + + :param location: the region. Required. + :type location: str + :param availability_parameters: Parameters supplied to the operation. Required. + :type availability_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NameAvailability or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.NameAvailability + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def check_name_availability( + self, + location: str, + availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]], + **kwargs: Any + ) -> _models.NameAvailability: + """Checks that the resource name is valid and is not already in use. + + :param location: the region. Required. + :type location: str + :param availability_parameters: Parameters supplied to the operation. Is either a + NameAvailabilityParameters type or a IO[bytes] type. Required. + :type availability_parameters: + ~azure.mgmt.appplatform.v2024_05_01_preview.models.NameAvailabilityParameters or IO[bytes] + :return: NameAvailability or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.NameAvailability + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NameAvailability] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(availability_parameters, (IOBase, bytes)): + _content = availability_parameters + else: + _json = self._serialize.body(availability_parameters, "NameAvailabilityParameters") + + _request = build_check_name_availability_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NameAvailability", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]: + """Handles requests to list all resources in a subscription. + + :return: An iterator like instance of either ServiceResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]: + """Handles requests to list all resources in a resource group. + + :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. Required. + :type resource_group_name: str + :return: An iterator like instance of either ServiceResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ServiceResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ServiceResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_supported_server_versions( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> Iterable["_models.SupportedServerVersion"]: + """Lists all of the available server versions supported by Microsoft.AppPlatform provider. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either SupportedServerVersion or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.SupportedServerVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.SupportedServerVersions] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_supported_server_versions_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SupportedServerVersions", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_skus_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_skus_operations.py new file mode 100644 index 00000000000..a175241e0b0 --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_skus_operations.py @@ -0,0 +1,160 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class SkusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`skus` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: + """Lists all of the available skus of the Microsoft.AppPlatform provider. + + :return: An iterator like instance of either ResourceSku or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ResourceSku] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.ResourceSkuCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ResourceSkuCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_storages_operations.py b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_storages_operations.py new file mode 100644 index 00000000000..2d04988f00b --- /dev/null +++ b/src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/operations/_storages_operations.py @@ -0,0 +1,655 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, service_name: str, storage_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "storageName": _SERIALIZER.url("storage_name", storage_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, service_name: str, storage_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "storageName": _SERIALIZER.url("storage_name", storage_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, service_name: str, storage_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "storageName": _SERIALIZER.url("storage_name", storage_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request(resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class StoragesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.v2024_05_01_preview.AppPlatformManagementClient`'s + :attr:`storages` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any + ) -> _models.StorageResource: + """Get the storage resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param storage_name: The name of the storage resource. Required. + :type storage_name: str + :return: StorageResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + storage_name=storage_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("StorageResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + storage_name: str, + storage_resource: Union[_models.StorageResource, IO[bytes]], + **kwargs: Any + ) -> _models.StorageResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(storage_resource, (IOBase, bytes)): + _content = storage_resource + else: + _json = self._serialize.body(storage_resource, "StorageResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + storage_name=storage_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("StorageResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("StorageResource", pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize("StorageResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + storage_name: str, + storage_resource: _models.StorageResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.StorageResource]: + """Create or update storage resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param storage_name: The name of the storage resource. Required. + :type storage_name: str + :param storage_resource: Parameters for the create or update operation. Required. + :type storage_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either StorageResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + storage_name: str, + storage_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.StorageResource]: + """Create or update storage resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param storage_name: The name of the storage resource. Required. + :type storage_name: str + :param storage_resource: Parameters for the create or update operation. Required. + :type storage_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either StorageResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + storage_name: str, + storage_resource: Union[_models.StorageResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.StorageResource]: + """Create or update storage resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param storage_name: The name of the storage resource. Required. + :type storage_name: str + :param storage_resource: Parameters for the create or update operation. Is either a + StorageResource type or a IO[bytes] type. Required. + :type storage_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource or + IO[bytes] + :return: An instance of LROPoller that returns either StorageResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + storage_name=storage_name, + storage_resource=storage_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("StorageResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.StorageResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.StorageResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + storage_name=storage_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete the storage resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param storage_name: The name of the storage resource. Required. + :type storage_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + service_name=service_name, + storage_name=storage_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterable["_models.StorageResource"]: + """List all the storages of one Azure Spring Apps resource. + + :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. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either StorageResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.StorageResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview") + ) + cls: ClsType[_models.StorageResourceCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("StorageResourceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data)